Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.lang.reflect.Array;
- import java.util.*;
- public class splittask {
- public static void main(String[] args) {
- String input = "3 2 4 5 | 3 45 5 | 3 8 7";
- input = input.replaceAll("\\s+", "");
- String[] splitinput = input.split("\\|");
- for(int i = splitinput.length-1;i>-1;i--){
- for(int j =0;j<splitinput[i].length();j++){
- System.out.print(splitinput[i].charAt(j)+" ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment