String.Split
works, provide you specify the
RemoveEmptyEntries
option, for instance:
string str = "123 456 7890";
string[] snum = str.Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries);
int[] v = new int[snum.Length];
for (int n = 0; n < v.Length; n++ )
{
v[n] = int.Parse(snum[n]);
}