I need to transform something like: "foo_bar_baz_2" to "fooBarBaz2"
I’m trying to use this Pattern:
Pattern pattern = Pattern.compile("_([a-z])");
Matcher matcher = pattern.matcher("foo_bar_baz_2");
Is it possible to use matcher to replace the first captured group (the letter after the ‘_’) with the captured group in upper case?
You can use appendReplacement/appendTail methods of the matcher like this: