My program has 3 Strings, that the user has already input, the purpose for this program is to capitalize all letters in the words. How do I capitalize all letters in each word using the toUpperCase(). This is what I have so far, this is a java code
public static String reverseOrder(String word1, String word2, String word3) {
if (word1.length() == 0) return word1;
return word1.substring(0, 1).toUpperCase() + word1.substring(1).toUpperCase();
}
I have only done it for 1 word but I need to capitalize all 3 words, thanks ***ok new code is this
public static String reverseOrder(String word1, String word2, String word3) {
int a = word1.length();
int b = word2.length();
int c = word3.length();
String x;
String y;
String z;
x = word1.toUpperCase();
y = word2.toUpperCase();
z = word3.toUpperCase();
}
}