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$\"
String str = "fish$"; String strVowels = "aeiouAEIOU"; String out = ""; for (Character c : str.toCharArray()) { if(!strVowels.contains(""+c)) { out = out + Character.toUpperCase(c); } else { out = out + c; } } System.out.println(out);