Capitalizes the first letter of each word. If allOthersLowerCase is true, then all
characters other than the first character of each word will also be changed to lower case.
Example
import*asSfrom"flurp/string";
constfirstCap = S.capitalizeWords(); constfirstCapOthersLower = S.capitalizeWords(true); firstCap("weaSEL and FERret"); // "WeaSEL And FERret" firstCapOthersLower("weaSEL and FERret")); // "Weasel And Ferret"
Capitalizes the first letter of each word. If
allOthersLowerCase
is true, then all characters other than the first character of each word will also be changed to lower case.Example