string birthday = "2009-08-08";
char[] spliter = { '-', ';', ',' };
string[] sItems = birthday.Split(spliter);
string str_years = sItems[0];
string str_month = sItems[1];
string str_day = sItems[2];
样可以分别读出年月日单独的字符
想要得到分割后的值,用for语句;
string[] s = ("中,华,人,民,共,和,国").Split(',');
for(int i=0;i <s.Length;i++)
{
System.Console.WriteLine(s[i]);
}
Console.ReadLine();