String (String message) { final int lineLength = 90; StringBuilder buf = new StringBuilder(message.length()); int index = 0; while (index < message.length()) { buf.append(message, index, Math.min(index + lineLength, message.length())).append('\n'); index += lineLength; } return buf.toString(); }