title: I am trying to add a string of integers into an array, but it is incorrect
body: <p>I have a string: </p>
  
  <pre><code>"1 2 3 4 5 6 7 8 9"
  </code></pre>
  
  <p>and I want it added into my array such that it becomes:</p>
  
  <pre><code>[1,2,3,4,5,6,7,8,9]
  </code></pre>
  
  <p>However, when I run my code, </p>
  
  <pre><code>int[] leftValues = new int[9];
      for (String w:left.split("\\s",0)){
        for (int i = 0; i&lt;9; i++){
          leftValues[i] = Integer.valueOf(w);
        }
      }
  </code></pre>
  
  <p>My output gives me :</p>
  
  <pre><code>[9,9,9,9,9,9,9,9,9]
  </code></pre>
  
  <p>May I know what am I doing wrong here?</p>