Strings.capitalize()
Syntax
function capitalize(string: string): string
Returns a new string with the first letter capitalized.
Parameters | |
string
|
The string whose first letter to capitalize. |
Example
import { Strings } from 'potence';
Strings.capitalize('hello'); // -> 'Hello'
Remarks
If the first character in the string is not a letter, or if it is an uppercase letter, this function will return the original string.
Contrast Strings.uncapitalize()
.