Is there a regex replacement term for the uppercase/lowercase version of a back reference?

Viewed 5547

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.

?

1 Answers
Related