Suppose I want to change the string string to "header"; where the first letter of each word is capitalized. Can this be done using a single call to replaceAll() with a modifier in the replacement expression?
For example,
str = str.replaceAll("\\b(\\S)", "???$1");
Where is the "???" this is some expression that adds up to the case of the next letter.
I saw that these are other tools (e.g. text panel) where \U will stack the next letter in upper case.
?
java string regex replace uppercase
Bohemian
source share