public class TextHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String[] |
getLines(String string)
Gets the lines in a text.
|
static String[] |
getWords(String string)
Gets the words in a text.
|
static String[] |
wrap(String string,
Font font,
int width)
Wraps a text in lines.
|
public static String[] getLines(String string)
A new line is started after a '\n'.
string
- the text to split.public static String[] getWords(String string)
A new word is started after a space ' '.
string
- the text.public static String[] wrap(String string, Font font, int width)
A new line is started:
string
- the text.font
- the font used to render the text.width
- the size of a line.