string str2="a,b,c";
Regex r = new Regex("(,)");
string[] s = r.Split(str2);

解决方案 »

  1.   

    string test = "fldsfl|fdsf|fdsf|";
    string[] test_string;
    test_string = test.Split('|');
    Response.Write(test_string[0]);
    Response.End();
    直接这样就行了
      

  2.   

    test_string = test.Split('|');
    我就是想当分开这个字符串的时候
    同时返它的最大索引值
      

  3.   

    那可以用 
    string test = "fldsfl|fdsf|fdsf|";
    string[] test_string;
    test_string = test.Split('|');
    int iLen = test_string.Length; //取得数组的个数
    Response.Write(test_string[0]);
    Response.Write(test_string[test_string.Length-1]);//输出最后一个值
    Response.End();