|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20所有这些字符串,把它的数字一个个剥离??
Posted on 2007-05-10 15:21 且行且思 阅读(1017) 评论(0) 收藏 举报using System;
public class Demo
{
static void Main()
{
string str = "|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20";
string delimStr = "|";
string[] split = str.Split(delimStr.ToCharArray());
int [] a = new int[split.Length - 1];
for(int i = 0; i < split.Length - 1; i++)
{
a[i] = int.Parse(split[i + 1]);
}
foreach (int temp in a)
{
Console.WriteLine(temp);
}
}
}
浙公网安备 33010602011771号