字符串拆分split
时间:2010-10-19 来源:gull
{
String s = "aa,bb,cc dd, ee";
const char comma = ',';
const char space = ' ';
char[] schar = new char[]
{
comma,
space
};
foreach (String s1 in s.Split(schar))
{
Console.WriteLine(s1);
}
}
foreach (String s1 in s.Split(schar))也可以直接写foreach (String s1 in s.Split(' ',','))
Split()使用params,参数不限定的
相关阅读 更多 +