飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

将一个字符串按照指定字符数进行分割

时间:2021-12-02  作者:匿名  
public static String[] splitStr(String str, int splitLen) {
        int count = 域名th() / splitLen + (域名th() % splitLen == 0 ? 0 : 1);
        String[] strs = new String[count];
        for (int i = 0; i < count; i++) {
            if (域名th() <= splitLen) {
                strs[i] = str;
            } else {
                strs[i] = 域名tring(0, splitLen);
                str = 域名tring(splitLen);
            }
        }
        return strs;
    }
————————————————
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。