title: Splitting string variable on a space or 2 spaces in C#
body: <p>I have a string variable, which is basically 3 strings, separated by one space each.These 3 strings may vary in length.
  Like </p>
  
  <pre><code>string line="XXX YY ZZ";
  </code></pre>
  
  <p>Now, it occassionally happens that my string variable <code>line</code>, consists of 3 strings, where the first and the second string are separated by 2 spaces, instead of one.</p>
  
  <pre><code>string line="XX  YY ZZ";
  </code></pre>
  
  <p>What I wanted to do is store the 3 strings in a string array.Like:</p>
  
  <p><code>string[] x</code> where <code>x[0]="XXX"</code> , <code>x[1]="YY"</code> , <code>x[2]="ZZ"</code></p>
  
  <p>I tried to use the Split function.</p>
  
  <pre><code>string[] allId = line.Split(' ');
  </code></pre>
  
  <p>It works for the first case, not for the second. Is there any neat, simple way to do this?</p>