I have string contains three numbers which seperated by comma or by space
.
For example: "3,3,3" or "3 3 3"
.
The string can contains also spaces between the numbers or at the start\end of the string.
I want to insert them into array
.
I did:
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]);
How can I insert the data into the array with less code lines?
Thanks!