Skip to content

toLowerCase

The toLowerCase() method returns a new string with all characters in lowercase.

Interactive example

Syntax

typescript
function toLowerCase<
	GenericInput extends string
>(
	input: GenericInput
): Lowercase<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 all characters in lowercase. The return type is precisely inferred thanks to TypeScript's Lowercase<GenericInput> utility type.

See also

Sources

Released under the MIT license.