C# Split用法

  string str = "1_01,2_02,3_03,4_04";
        string[] s1 = str.Split(',');
        string s2 = "";
        for (int i = 0; i < s1.Length; i++)
        {
            s2 = s1[i].ToString().Split('_')[0];
            Response.Write("<script>alert(" + s2 + ")</script>");
        }

posted @ 2011-08-10 15:05  agen  阅读(66)  评论(0)    收藏  举报