Converts a string to title case, capitalizing content words while keeping
articles, prepositions, and conjunctions lowercase unless they are the
first or last word.
Parameters
value: string
Input split on case transitions, whitespace, and punctuation.
Optional locale for case mapping (defaults to system locale).
Returns string
Title-cased phrase; articles, prepositions, and conjunctions stay lowercase except as the first or last word.
Example
titleCase("a comparison of cases"); // "A Comparison of Cases" titleCase("the wind in the willows"); // "The Wind in the Willows" titleCase("lost in translation"); // "Lost in Translation" ("in" stays lowercase)
Converts a string to title case, capitalizing content words while keeping articles, prepositions, and conjunctions lowercase unless they are the first or last word.