编程语言
首页 > 编程语言> > c# 字符串递归截取

c# 字符串递归截取

作者:互联网

   private void button1_Click_1(object sender, EventArgs e)
        {
            string ex = neirong.Text;
            List<string> d = new List<string>();
            getlist(ex,ref d);

            var ss = d;
        }

        private void getlist(string strs,ref List<string> d)
        {
            if (strs.Length > 290)
            {
                string sy = "";
                string zj = strs.Substring(0, 290);
                int djindex = zj.LastIndexOf('。');
                d.Add(strs.Substring(0, djindex));

                sy = strs.Remove(0, djindex);
                getlist(sy, ref d);
            }
            else
            {
                d.Add(strs);
            }
        }

  

标签:sy,string,递归,c#,截取,getlist,List,strs,ref
来源: https://www.cnblogs.com/sishahu/p/11377664.html