日期:2014-05-20 浏览次数:20704 次
String str="........"; Pattern p = Pattern.compile(".+\\。|.{100}|.+"); for(;str.length()!=0;) { String test = null; if(str.length()>=100) { test = str.substring(0, 100); } else { test = str; } Matcher m = p.matcher(test); while(m.find()) { System.out.println(m.group()); test = m.group(); break; } str = str.substring(test.length(), str.length()); }