i would like to use a regular expression for the following problem:
SOME_RANDOM_TEXT
should be converted to:
someRandomText
so, the _(any char) should be replaced with just the letter in upper case. i found something like that, using the tool:
_\w and $&
how to get only the second letter from the replacement?? any advice? thanks.
It might be easier simply to
String.split("_")and then rejoin, capitalising the first letter of each string in your collection.Note that Apache Commons has lots of useful string-related stuff, including a join() method.