Capitalizes the first character of a string.
If the string is empty, it returns an empty string.
The input string.
The input string with the first character converted to uppercase.
1.1.0
capitalize('hello'); // 'Hello'capitalize('world'); // 'World'capitalize(''); // '' Copy
capitalize('hello'); // 'Hello'capitalize('world'); // 'World'capitalize(''); // ''
Capitalizes the first character of a string.
If the string is empty, it returns an empty string.