Skip to content

uncapitalize ​

The uncapitalize() method returns a new string with the first letter lowercased.

Interactive example ​

Syntax ​

typescript
function uncapitalize<
	GenericInput extends string
>(
	input: GenericInput
): Uncapitalize<GenericInput>

Parameters ​

  • input: The string to modify. The type is generic (GenericInput extends string) to allow precise literal type inference.

Return value ​

A new string with the first letter lowercased. The return type is precisely inferred thanks to TypeScript's Uncapitalize<GenericInput> utility type.

See also ​

Sources ​

Released under the MIT license.