public class StringUtilRt
extends java.lang.Object
StringUtil
.
Intended to use by external (out-of-IDE-process) runners and helpers so it should not contain any library dependencies.Constructor and Description |
---|
StringUtilRt() |
Modifier and Type | Method and Description |
---|---|
static boolean |
charsEqualIgnoreCase(char a,
char b) |
static java.lang.CharSequence |
convertLineSeparators(java.lang.CharSequence text,
java.lang.String newSeparator) |
static java.lang.String |
convertLineSeparators(java.lang.String text)
Converts line separators to
"\n" |
static java.lang.String |
convertLineSeparators(java.lang.String text,
boolean keepCarriageReturn) |
static java.lang.String |
convertLineSeparators(java.lang.String text,
java.lang.String newSeparator) |
static java.lang.String |
convertLineSeparators(java.lang.String text,
java.lang.String newSeparator,
int[] offsetsToKeep) |
static java.lang.String |
convertLineSeparators(java.lang.String text,
java.lang.String newSeparator,
int[] offsetsToKeep,
boolean keepCarriageReturn) |
static boolean |
endsWith(java.lang.CharSequence text,
java.lang.CharSequence suffix) |
static boolean |
endsWithChar(java.lang.CharSequence s,
char suffix) |
static boolean |
endsWithIgnoreCase(java.lang.CharSequence text,
java.lang.CharSequence suffix) |
static boolean |
equal(java.lang.CharSequence s1,
java.lang.CharSequence s2,
boolean caseSensitive) |
static java.lang.String |
formatFileSize(long fileSize) |
static java.lang.String |
formatFileSize(long fileSize,
java.lang.String unitSeparator) |
static java.lang.String |
getShortName(java.lang.Class<?> aClass) |
static java.lang.String |
getShortName(java.lang.String fqName) |
static java.lang.String |
getShortName(java.lang.String fqName,
char separator) |
static boolean |
isEmpty(java.lang.CharSequence cs) |
static boolean |
isEmptyOrSpaces(java.lang.CharSequence s) |
static boolean |
isQuotedString(java.lang.String s) |
static int |
lastIndexOf(java.lang.CharSequence s,
char c,
int start,
int end)
Allows to retrieve index of last occurrence of the given symbols at
[start; end) sub-sequence of the given text. |
static java.lang.String |
notNullize(java.lang.String s) |
static java.lang.String |
notNullize(java.lang.String s,
java.lang.String defaultValue) |
static double |
parseDouble(java.lang.String string,
double defaultValue) |
static int |
parseInt(java.lang.String string,
int defaultValue) |
static long |
parseLong(java.lang.String string,
long defaultValue) |
static java.util.List<java.lang.String> |
splitHonorQuotes(java.lang.String s,
char separator) |
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String prefix) |
static char |
toLowerCase(char a) |
static char |
toUpperCase(char a) |
static java.lang.String |
unquoteString(java.lang.String s) |
static java.lang.String |
unquoteString(java.lang.String s,
char quotationChar) |
public static boolean equal(java.lang.CharSequence s1, java.lang.CharSequence s2, boolean caseSensitive)
public static boolean charsEqualIgnoreCase(char a, char b)
public static char toUpperCase(char a)
public static char toLowerCase(char a)
public static java.lang.String convertLineSeparators(java.lang.String text)
"\n"
public static java.lang.String convertLineSeparators(java.lang.String text, boolean keepCarriageReturn)
public static java.lang.String convertLineSeparators(java.lang.String text, java.lang.String newSeparator)
public static java.lang.CharSequence convertLineSeparators(java.lang.CharSequence text, java.lang.String newSeparator)
public static java.lang.String convertLineSeparators(java.lang.String text, java.lang.String newSeparator, int[] offsetsToKeep)
public static java.lang.String convertLineSeparators(java.lang.String text, java.lang.String newSeparator, int[] offsetsToKeep, boolean keepCarriageReturn)
public static int parseInt(java.lang.String string, int defaultValue)
public static long parseLong(java.lang.String string, long defaultValue)
public static double parseDouble(java.lang.String string, double defaultValue)
public static java.lang.String getShortName(java.lang.Class<?> aClass)
public static java.lang.String getShortName(java.lang.String fqName)
public static java.lang.String getShortName(java.lang.String fqName, char separator)
public static boolean endsWithChar(java.lang.CharSequence s, char suffix)
public static boolean endsWith(java.lang.CharSequence text, java.lang.CharSequence suffix)
public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String prefix)
public static boolean endsWithIgnoreCase(java.lang.CharSequence text, java.lang.CharSequence suffix)
public static int lastIndexOf(java.lang.CharSequence s, char c, int start, int end)
[start; end)
sub-sequence of the given text.s
- target textc
- target symbol which last occurrence we want to checkstart
- start offset of the target text (inclusive)end
- end offset of the target text (exclusive)-1
otherwisepublic static boolean isEmpty(java.lang.CharSequence cs)
public static boolean isEmptyOrSpaces(java.lang.CharSequence s)
public static java.lang.String notNullize(java.lang.String s)
public static java.lang.String notNullize(java.lang.String s, java.lang.String defaultValue)
public static java.util.List<java.lang.String> splitHonorQuotes(java.lang.String s, char separator)
public static java.lang.String formatFileSize(long fileSize)
public static java.lang.String formatFileSize(long fileSize, java.lang.String unitSeparator)
public static boolean isQuotedString(java.lang.String s)
public static java.lang.String unquoteString(java.lang.String s)
public static java.lang.String unquoteString(java.lang.String s, char quotationChar)