Using a for loop, how do I go about making all consonants in a string uppercase?
I think I should do something like this:
String str = \"fish$\"
This works for me:
List constants = Arrays.asList('f', 's', 'h'); String str = "fish$"; for (Character c : constants) { str = str.replace(c, Character.toUpperCase(c)); }