for (int i = 0, len = input.length(); i < len; i++) {
char ch = input.charAt(i);
if (i % 2 == 0) {
System.out.print(Character.toLowerCase(ch));
} else {
System.out.print(Character.toUpperCase(ch));
}
}
I want to do this without using the character class. Only using tolowerCase and toUpperCase and basic loops.
So, the basic program would be converting a string like "Hello World" to "HeLlo WoRlD" without using the character class.
I'm told you can do it, but I can't figure it out. It's really bugging me