Skip to main content
Version: Next

capitalizeFirstLetter

Using

Function takes a string and returns a new string with the first letter capitalized.

Demo - use JSON
capitalizeFirstLetter(
)
"Any string"

Arguments

ArgumentTypeDescriptionExample
strstringString"some value"
"hello"

Returns

string | undefined — String with the first letter capitalized or undefined if str is not string.

Examples

capitalizeFirstLetter('some value for function');
// "Some value for function"

capitalizeFirstLetter('hello');
// "Hello"

capitalizeFirstLetter('Any');
// "Any"

capitalizeFirstLetter('2ok');
// "2ok"

Resources

📦 Since:1.2.0
📦 Last updated:1.2.0
📦 Available in:1.3.0