ts-humanize / capitalizeWord
capitalizeWord(
str):string
Defined in: formatting/strings.ts:40
Capitalizes the first character of a string, preserving any leading whitespace. If the string starts with whitespace, capitalizes the first non-whitespace character after each whitespace.
string
The string to capitalize.
string
The capitalized string.
capitalizeWord("hello world"); // "Hello world"capitalizeWord(" hello"); // " Hello"