Converts a string to title case.
function toTitleCase( input: string): stringstringConverts a string to title case.
stringstringConverts a string to title case.
Capitalizes the first letter of each word, except for small words (like "of", "and", "the") unless they appear at the beginning. Preserves words already containing uppercase letters (e.g., acronyms).
toTitleCase("the quick brown fox"); // "The Quick Brown Fox"
toTitleCase("a tale of two cities"); // "A Tale of Two Cities"
toTitleCase("in the heart of the sea"); // "In the Heart of the Sea"
toTitleCase("API reference guide"); // "API Reference Guide"
toTitleCase(" war and peace "); // "War and Peace"
