Functions utils for strings
- Source
Methods
(static) capitalize(input) → {string}
Capitalizes the first letter of a string.
Parameters:
Name | Type | Description |
---|---|---|
input | string | The string to capitalize. |
- Source
Throws:
- If the input is not a string.
- Type
- TypeError
Returns:
- The capitalized string.
- Type:
- string
Example
capitalize("hello"); // "Hello"
capitalize("world"); // "World"