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
capitalize- Uppercases the first lettertoUpperCase- Converts the whole string to uppercasetoLowerCase- Converts the whole string to lowercase
Sources
- TypeScript - Uncapitalize<StringType> - TypeScript utility type for type inference
