110,566
社区成员
发帖
与我相关
我的任务
分享
int[] arr;
string str = @"20 5231 214 55";
string strmatch = @"[\d]+";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(strmatch);
System.Text.RegularExpressions.MatchCollection mc = reg.Matches(str);
arr = new int[mc.Count];
for (int i = 0; i < mc.Count; i++)
{
arr[i] = Convert.ToInt32(mc[i].Value);
}