| Modifier and Type | Method and Description |
|---|---|
static String |
escapeNewlines(String string)
Escapes all newline sequences in a string with "\n".
|
static String |
ltrim(String string)
Trims the whitespace off the left side of a string.
|
static String |
rtrim(String string)
Trims the whitespace off the right side of a string.
|
public static String ltrim(String string)
string - the string to trimpublic static String rtrim(String string)
string - the string to trimpublic static String escapeNewlines(String string)
Escapes all newline sequences in a string with "\n".
This method is 3x faster than a regex when the string has newlines to escape and 6x faster when it doesn't have newlines to escape.
string - the stringCopyright © 2016–2018 Michael Angstadt. All rights reserved.