Anonymous
public java v1 · immutable int count = 0; char[] c = buttonText.toCharArray(); System.out.println (new String (c)); for (int j=0; j<c.length; j++) { count++; if (count>10){ while (c[j]!=0) { if (c[j]==' '){ c[j]='\n'; count=0; break; } j--; } } if (c[j]=='\n'){ count = 0; } } System.out.println (new String (c));