title: convert numbers in string to double array few code lines c#
body: <p>I have string contains three numbers which <code>seperated by comma or by space</code>.</p>
  
  <p>For example: <code>"3,3,3" or "3 3 3"</code>. </p>
  
  <p>The string can contains also spaces between the numbers or at the start\end of the string.</p>
  
  <p>I want to <code>insert them into array</code>.</p>
  
  <p>I did:</p>
  
  <pre><code>this.ang[0] = Convert.ToDouble(ang.Trim().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)[0]);
  this.ang[1] = Convert.ToDouble(ang.Trim().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)[1]);
  this.ang[2] = Convert.ToDouble(ang.Trim().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)[2]);
  </code></pre>
  
  <p>How can I insert the data into the array with less code lines?</p>
  
  <p>Thanks!</p>