The value to be converted to capitalized words
The Capitalized Words version of the provided value
strCapitalizeWords(null); // "Null"
strCapitalizeWords(undefined); // "Undefined"
strCapitalizeWords("hello darkness"); // "Hello Darkness"
strCapitalizeWords("hELLo dARKness"); // "Hello Darkness"
strCapitalizeWords("hello_darkness"); // "Hello_Darkness"
strCapitalizeWords("hello-darkness"); // "Hello-Darkness"
strCapitalizeWords("hello darkness, my old friend."); // "Hello Darkness, My Old Friend."
Convert the provided value to
Capitalized Words, where each detected word starts with an uppercase character and the remaining characters of that word are lowercased.Word boundaries are detected using standard
\bboundaries and_separators, so existing separators (spaces, punctuation,_, and-) are retained. If the value is not a string it will be converted.