Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String everyOtherLowerCase(String input) {
- input = input.toLowerCase();
- StringBuffer result = new StringBuffer("");
- for(int x=0; x<input.length(); x++) {
- Character c = input.charAt(x);
- if(x % 2 == 0) result.append(c);
- else result.append(Character.toUpperCase(c));
- }
- return result.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement