viewing paste Unknown #922 | Plain text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13
private int[] Splitter(){
           //Use split method to put the String into String array separated with " " delimeter
           String inputString = inputsjTextField.getText();
           String[] stringParts = inputString.split(" ");
           
           //Convert String array to int array
           int[] inputs = new int[stringParts.length];
           for (int i=0; i < stringParts.length; i++) {
               inputs[i] = Integer.parseInt(stringParts[i]);
               //System.out.println(inputs[i]);
           }
           return inputs;
    }
Viewed 324 times, submitted by unknown.