首页 > 其他 > 详细

按长度截取字符串

时间:2020-05-22 15:42:24      阅读:54      评论:0      收藏:0      [点我收藏+]

 

截取字符串

技术分享图片
 public static String[] getstr(string strs, int len)
        {
            double i = strs.Length;
            string[] myarray = new string[int.Parse(Math.Ceiling(i / len).ToString())];
            for (int j = 0; j < myarray.Length; j++)
            {
                len = len <= strs.Length ? len : strs.Length;
                myarray[j] = strs.Substring(0, len);
                strs = strs.Substring(len, strs.Length - len);
            }
            return myarray;
        }
View Code

原博主地址:https://blog.csdn.net/roguemaster/article/details/17756823

按长度截取字符串

原文:https://www.cnblogs.com/lll-strive/p/12937276.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!