title: Split string to array, remove empty spaces
body: <p>I have a question about splitting string. I want to split string, but when in string see chars "" then don't split and remove empty spaces. </p>
  
  <p>My String:</p>
  
  <pre><code>String tmp = "abc 123 \"Edk k3\" String;";
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>1: abc
  2: 123
  3: Edkk3  // don't split after "" and remove empty spaces
  4: String
  </code></pre>
  
  <p>My code for result, but I don't know how to remove empty spaces in ""</p>
  
  <pre><code>var tmpList = tmp.Split(new[] { '"' }).SelectMany((s, i) =&gt;
                  {
                      if (i % 2 == 1) return new[] { s };
                      return s.Split(new[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);
                  }).ToList();
  </code></pre>
  
  <p>Or but this doesn't see "", so it splits everything</p>
  
  <pre><code>string[] tmpList = tmp.Split(new Char[] { ' ', ';', '\"', ',' }, StringSplitOptions.RemoveEmptyEntries);
  </code></pre>