Suppose I want to change a lowercase string to "title case"; where the first letter of every word is capitalized. Can this be done using a single call to replaceAll()
by using a modifier in the replacement expression?
For example,
str = str.replaceAll("\\b(\\S)", "???$1");
Where "???" is some expression that folds the case of the next letter.
I have seen this is other tools (like textpad), where \U
will fold the next letter to uppercase.
?