第2个回答 2012-06-08
String s = "abcd;ljas;dv1235\n6qweq";
int len = s.length();
StringBuffer stb = new StringBuffer();
for(int i=0,pos=1; i<len; i++,pos++) {
char c = s.charAt(i);
if(c == '\n') pos = 0;
stb.append(c);
if(pos>=116) {
pos = 0;
stb.append("\n");
}
}
System.out.println(stb.toString());