public final class StringUIUtils extends Object
String
s, mainly shown in UI.
Allows to show whitespace characters (spaces, newlines and tabs).
Modifier and Type | Field and Description |
---|---|
static String |
CARRIAGE_RETURN_SYMBOL |
static String |
LINE_FEED_SYMBOL |
static String |
SPACE_SYMBOL |
static String |
TAB_SYMBOL |
Modifier and Type | Method and Description |
---|---|
static String |
addVisibleNewLineChars(String string)
Returns a string with visible new line characters, shown along the invisible ones.
|
static boolean |
containsNewLineChars(String string)
Tells whether or not the given
string contains or not new line characters (both line
feed as carriage return). |
static String |
replaceWithVisibleWhiteSpaceChars(String string)
Returns a string with visible whitespace characters, removing the invisible ones.
|
public static final String SPACE_SYMBOL
public static final String TAB_SYMBOL
public static final String CARRIAGE_RETURN_SYMBOL
public static final String LINE_FEED_SYMBOL
public static String replaceWithVisibleWhiteSpaceChars(String string)
It's replaced carriage return, line feed, tabs and spaces with visible (replacement) characters.
string
- the source stringpublic static String addVisibleNewLineChars(String string)
string
- the source stringpublic static boolean containsNewLineChars(String string)
string
contains or not new line characters (both line
feed as carriage return).string
- the string that will be testedtrue
if the string contains at least one new line character, false
otherwise.