Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void changeString(String in){
- String out[] = in.split(" ");
- for(int j = 0; j < out.length; j++){
- for(int i = 1; i < out[j].length(); i = i+2){
- System.out.print(out[j].charAt(i));
- System.out.print(out[j].charAt(i-1));
- }
- if(out[j].length() % 2 != 0){
- System.out.print(out[j].charAt(out[j].length()-1));
- }
- System.out.print(" ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement