Modifier and Type | Method and Description |
---|---|
static String |
indent(String toIndent,
String indentWith)
|
static String |
wrapString(String toWrap,
int maxLineLength)
Word-wraps a
String (ensures it fits within a certain width). |
public static String wrapString(String toWrap, int maxLineLength)
String
(ensures it fits within a certain width).
Note: this does not work properly with text containing tab characters
(\t
).toWrap
- The String
to be word-wrapped.maxLineLength
- How long a line can reach before it's split in two.
Must be at least 2, otherwise it will return an
empty String.toWrap
wrapped to maxLineLength
width.