ts-humanize / formatSentence
formatSentence(
sentence,options?):string
Defined in: formatting/strings.ts:135
Formats a sentence by capitalizing the first word (or all words if capitalizeAllWords is true), removing extra spaces, and normalizing words to lowercase unless specified in the preserve list.
string
The sentence to format.
FormatSentenceOpts
Formatting options.
string
The formatted sentence.
formatSentence(" hElLo wOrLD "); // "Hello world"formatSentence("API HTTP Response", { preserve: ["HTTP"] }); // "Api HTTP response"