package com.demo.aaa;
import java.util.ArrayList;
import java.util.List;
/**
* Hello world!
*
*/
public class App {
private static int splitLen = 10;
public static void main( String[] args ){
String contents =" iuy 012341112 12A9999977 a 12344 bcjs sisisisij sjssye 19394 882373 s9sjj9878 i ";
List<String> contentList = new ArrayList<String>();
try {
splitStr( contents,contentList) ;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(contentList.size());
for(String str:contentList) {
System.out.println(str);
}
}
public static void splitStr(String contents,List<String> contentList) throws Exception {
int len = splitLen+1;
if(contents!=null && contents.trim().length()==0) {
return ;
}else if(contents.length()<splitLe
需求:拆分短信内容,按照160个字符进行拆分,短信内容是英文
最新推荐文章于 2022-08-20 12:30:00 发布