首页  ·  知识 ·  编程语言
split正确用法
佚名  丁红根的博客  .NET  编辑:dezai  图片来源:网络
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string s = "ddddddd";
            s.Replace("d","c");
            Response.Write(s);

            string   Type="1,2,3"; 
            string[]   myarray=Type.Split(new   char[]{','});
            string d = "abcertabcrtgabcder";
            char[] abc = "abc".ToCharArray();
           string []k=d.Split(abc);
           foreach (string j in k)
           {
               Response.Write(j + "
");

           }

            string delimStr = "abc";
            char[] delimiter = delimStr.ToCharArray();
            //string words = "one two,three:four.";
            string[] splits = null;
            for (int x = 1; x <= 5; x++)
            {
                splits = d.Split(delimiter, x);
               //Response.Write("\ncount = {0,2} .............."+ x);
                foreach (string s1 in splits)
                {
                    Response.Write( s1+"
");
                }
            }

本文作者:佚名 来源:丁红根的博客
CIO之家 www.ciozj.com 微信公众号:imciow
   
免责声明:本站转载此文章旨在分享信息,不代表对其内容的完全认同。文章来源已尽可能注明,若涉及版权问题,请及时与我们联系,我们将积极配合处理。同时,我们无法对文章内容的真实性、准确性及完整性进行完全保证,对于因文章内容而产生的任何后果,本账号不承担法律责任。转载仅出于传播目的,读者应自行对内容进行核实与判断。请谨慎参考文章信息,一切责任由读者自行承担。
延伸阅读