"abc,def,ccc,ddd;qwe,rty;cccc;"以分号为间隔,再以逗号为间隔,取第一个
string str1 = "abc,def,ccc,ddd;qwe,rty;cccc;";
string[] str2 = str1.Split(';');
//Response.Write(str2.Length);
//Response.Write(str2[2].ToString());
foreach (string s in str2)
{
string[] singleStr = s.Split(',');
Response.Write(singleStr[0] + "<br />");
}
string[] str2 = str1.Split(';');
//Response.Write(str2.Length);
//Response.Write(str2[2].ToString());
foreach (string s in str2)
{
string[] singleStr = s.Split(',');
Response.Write(singleStr[0] + "<br />");
}
合乎自然而生生不息。。。