title: Java Split String to String arry
body: <p>Input: <code>"   10   50 10 40  50   80   60 20 "</code>.
  I want to convert it into string array then into int array. The problem is that when I split with space, it shows errors as: </p>
  
  <ul>
  <li>1st string is <code>"   10"</code></li>
  <li>2nd string is <code>" 50"</code></li>
  <li>3rd string is <code>"10"</code></li>
  </ul>
  
  <p>Code:</p>
  
  <pre><code>s = line.split(" ");
  for(i=0;i&lt;8;i++)
  {
      arr= Integer.parseInt(s[i]);
      System.out.println(arr);
  }
  </code></pre>
  
  <p>I want it should only string array with no space </p>
  
  <ul>
  <li>1st string is <code>"10"</code></li>
  <li>2nd string is <code>"50"</code></li>
  <li>3rd string is <code>"10"</code></li>
  </ul>