Skip to content

Function: lowerFirst()

ts
function lowerFirst(value): string;

Converts the first character of a string to lowercase. 将字符串的第一个字符转换为小写。

Parameters

ParameterTypeDescription
valuestringThe string to convert / 要转换的字符串

Returns

string

The string with the first character in lowercase / 第一个字符为小写的字符串

Example

typescript
lowerFirst('Apple') // => "apple"
lowerFirst('HELLO WORLD') // => "hELLO WORLD"
lowerFirst('Hello') // => "hello"
lowerFirst('') // => ""
lowerFirst('A') // => "a"
lowerFirst('123ABC') // => "123ABC"
lowerFirst('Åpple') // "åpple" (works with Unicode)

Since

1.0.0

Released under the MIT License.