Uncapitalize<S>

Converts the first character of the string literal type S to lowercase.

Since TS 4.1 Spec ↗

Syntax

Uncapitalize<StringType>

Returns

string literal type — A string literal type with the first character lowercased.

Examples

type T = Uncapitalize<'Hello'>; // 'hello'
type Field<T extends string> = Uncapitalize<T>;
type F = Field<'UserName'>; // 'userName'

Notes

An intrinsic compiler type. Only the first character is affected. Distributes over unions and template literal types. Inverse of `Capitalize`.

See also