public class StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
EMPTY_STRING |
static String |
FALSE |
static String |
TRUE |
static Collection<String> |
TRUE_FALSE_ARRAY |
Modifier and Type | Method and Description |
---|---|
static String |
cleanPathForWindows(String pathString) |
static String |
escapeBackticks(String text) |
static int |
findExprBeforeAt(String text,
String expr,
int offset) |
static String |
getDefaultString(String text)
Given a string will give back a non null string that is either the given
string, or an empty string.
|
static int |
getFrontWhitespaceLength(String text)
Returns the number of consecutive whitespace characters in front
of text
|
static int |
getNumberOfNewLines(String text,
boolean isWhitespace,
String delimiter,
int newLineLimit)
Given a string that is only whitespace, this will return the amount of
newline characters.
|
static int |
getOffsetAfterWhitespace(String text,
int endOffset)
Traverses backwards from the endOffset until it finds a whitespace character.
|
static String |
getStartWhitespaces(String lineText)
Returns the start whitespaces of the given line text.
|
static String |
getString(Object obj) |
static int |
getTrailingWhitespaceLength(String text)
Returns the number of consecutive whitespace characters from
the end of text
|
static boolean |
isEmpty(String value) |
static boolean |
isQuote(char c) |
static boolean |
isTagOutsideOfBackticks(String text) |
static boolean |
isWhitespace(String value) |
static String |
lTrim(String value) |
static String |
normalizeSpace(String str)
Returns the result of normalize space of the given string.
|
static void |
normalizeSpace(String str,
StringBuilder b)
Normalizes the whitespace characters of a given string and applies it to the
given string builder.
|
static String |
trimNewLines(String value) |
static void |
trimNewLines(String value,
StringBuilder s) |
public static final String[] EMPTY_STRING
public static final String TRUE
public static final String FALSE
public static final Collection<String> TRUE_FALSE_ARRAY
public static boolean isEmpty(String value)
public static boolean isQuote(char c)
public static boolean isWhitespace(String value)
public static void normalizeSpace(String str, StringBuilder b)
str
- public static String normalizeSpace(String str)
str
- public static String getStartWhitespaces(String lineText)
lineText
- public static void trimNewLines(String value, StringBuilder s)
public static int getNumberOfNewLines(String text, boolean isWhitespace, String delimiter, int newLineLimit)
text
- isWhitespace
- delimiter
- public static String getDefaultString(String text)
text
- public static int getOffsetAfterWhitespace(String text, int endOffset)
text
- endOffset
- non-inclusivepublic static int getFrontWhitespaceLength(String text)
text
- String of interestpublic static int getTrailingWhitespaceLength(String text)
text
- String of interestpublic static boolean isTagOutsideOfBackticks(String text)
Copyright © 2020. All rights reserved.