方法如下,使用正则表达式:
string abc = "3 45 55 55 676 11";
string str = System.Text.RegularExpressions.Regex.Replace(abc, @"\s+", ",");
string[] aa =str.Split(',');
也可以直接分割:
string[] aa = System.Text.RegularExpressions.Regex.Split(abc, @"\s+");
from: http://hi.baidu.com/zhenzhounew/item/87497ee3be1277c3baf37df8