TITLECASE
Last updated
Was this helpful?
Last updated
Was this helpful?
**The function TITLECASE capitalizes each word in a String according to common English title conventions. **
This function takes a as input and capitalizes each space-separated word in the String according to the following rules.
By default, all words are capitalized.
The first and last words are always capitalized.
Both parts of hyphenated words are capitalized.
Capitalization in the original string remains unchanged to allow for capitalized acronyms such as "CXR". However, the following words are an exception.
Articles such as "a", "an", and "the" are lowercased.
Conjunctions such as "and", "but", "or", and "nor" are lowercased.
Short prepositions such as "as", "at", "by", "for", "in", "of", "on", "per", "to", and "via" are lowercased.
Abbreviations for the word versus such as "vs.", "vs", "v.", "v" are lowercased.
The words "en", and "if" are lowercased.
input_string (type: string) Any string.
title_cased_string (type: string) The input_string reformatted in Title Case.
When called with this string containing all lower case letters, each word is capitalized except for the article.
Even if the article was originally capitalized, it will be converted to lowercase in the final output.
In the following example, the word "on" is normally considered a preposition that should be lowercase, however, the last word of the string will always be capitalized.
If the original string contains any capitalization that doesn't have a specific exception like articles, conjunctions, and prepositions, then that capitalization remains. In this example, we include the acronym "CXR" for Customer Experience Runtime.