title: Splitting a string with multiple spaces
body: <p>I want to split a string like </p>
  
  <pre><code>"first     middle  last" 
  </code></pre>
  
  <p>with <code>String.split()</code>. But when i try to split it I get </p>
  
  <pre><code>String[] array = {"first","","","","middle","","last"}
  </code></pre>
  
  <p>I tried using <code>String.isEmpty()</code> to check for empty strings after I split them but I it doesn't work in android.  Here is my code:</p>
  
  <pre><code>String s = "First  Middle Last";
  String[] array = s.split(" ");
  for(int i=0; i&lt;array.length; i++) {
    //displays segmented strings here
  }
  </code></pre>
  
  <p>I think there is a way to split it like this: <code>{"first","middle","last"}</code> but can't figure out how.</p>
  
  <p>Thanks for the help!</p>