ts-humanize / capitalizeSentence
capitalizeSentence(
sentence,capitalizeAllWords?):string
Defined in: formatting/strings.ts:77
Capitalizes the first character of a sentence, or the first character after each whitespace if capitalizeAllWords is true. Preserves all original whitespace and does not normalize letter casing except for capitalization.
See formatSentence to trim and clean whitespace.
string
The sentence to capitalize.
boolean = false
Whether to capitalize every word in the sentence.
string
The capitalized sentence.
capitalizeSentence("hello world"); // "Hello world"capitalizeSentence("hello world", true); // "Hello World"