int length = 40; int begin = 0; // 截取字符串开始 int end = length; // 截取字符串结束 int txtlength = txt.length(); while(txtlength%end!=txtlength){ if(txtlength%end==txtlength && txtlength<end){ list.add(txt.substring(begin, txtlength)); }else{ list.add(txt.substring(begin, end)); } //txtlength = txtlength-end; begin = end; end +=length; }当红色部分符合是,是直接跳出,求解
添加回答
举报
0/150
提交
取消