public class StringUtil extends Object
this#toSymbolCase(CharSequence, char)this#toCamelCase(CharSequence, char)this#subBefore(String, String)| 限定符和类型 | 字段和说明 |
|---|---|
static String |
EMPTY |
static String[] |
EMPTY_ARRAY |
static char |
UNDERLINE |
| 构造器和说明 |
|---|
StringUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static StringBuilder |
appends(StringBuilder builder,
CharSequence... charSequences)
combination CharSequence, to StringBuilder
|
static StringBuilder |
createBuilder(CharSequence... charSequences)
combination CharSequence, get a StringBuilder
|
static String |
emptyToNull(String str)
Returns the given string if it is nonempty;
null otherwise. |
static boolean |
hasEmpty(CharSequence... strList)
Has empty.
|
static boolean |
isAllNotEmpty(CharSequence... args)
Is all not empty.
|
static boolean |
isBlank(CharSequence str)
Is blank.
|
static boolean |
isEmpty(CharSequence str)
Is empty.
|
static boolean |
isNotBlank(CharSequence str)
Is not blank.
|
static boolean |
isNotEmpty(CharSequence str)
Is not empty.
|
static boolean |
isNullOrEmpty(String str)
已过时。
|
static String |
newBuilder(CharSequence... charSequences)
combination CharSequence, get a String
|
static String |
nullToEmpty(String str)
Returns the given string if it is non-null; the empty string otherwise.
|
static String |
replace(String str,
String searchStr,
String replaceStr)
Replace a portion of the string, replacing all found
|
static String[] |
split(String str,
String separatorChars)
Splits the provided text into an array, separators specified.
|
static boolean |
startWith(String str,
String prefix)
Tests if this string starts with the specified prefix.
|
static String |
subBefore(String str,
String symbol)
get the string before the delimiter
|
static String |
toCamelCase(CharSequence str,
char symbol)
to camel case
|
static String |
toSymbolCase(CharSequence str,
char symbol)
To symbol case.
|
static String |
toUnderlineCase(CharSequence str)
To underline case.
|
public static final char UNDERLINE
public static final String[] EMPTY_ARRAY
public static String emptyToNull(String str)
null otherwise.str - public static String nullToEmpty(String str)
str - @Deprecated public static boolean isNullOrEmpty(String str)
true if the given string is null or is the empty string.
this method has been deprecated, use isEmpty() instead.
str - public static boolean isBlank(CharSequence str)
str - public static boolean isEmpty(CharSequence str)
str - public static boolean isNotEmpty(CharSequence str)
str - public static boolean isNotBlank(CharSequence str)
str - public static boolean isAllNotEmpty(CharSequence... args)
args - public static boolean hasEmpty(CharSequence... strList)
strList - public static String toUnderlineCase(CharSequence str)
str - public static String toSymbolCase(CharSequence str, char symbol)
str - symbol - public static String toCamelCase(CharSequence str, char symbol)
str - CharSequencesymbol - symbolpublic static String newBuilder(CharSequence... charSequences)
charSequences - CharSequence, if null or empty, get EMPTYpublic static StringBuilder createBuilder(CharSequence... charSequences)
charSequences - CharSequencepublic static StringBuilder appends(StringBuilder builder, CharSequence... charSequences)
builder - StringBuilder, if null create a newcharSequences - CharSequencepublic static String replace(String str, String searchStr, String replaceStr)
str - A string to operate onsearchStr - The replaced stringreplaceStr - The replaced stringpublic static String[] split(String str, String separatorChars)
Splits the provided text into an array, separators specified.
StringUtils.split(null, *) = null
StringUtils.split("", *) = []
StringUtils.split("abc def", null) = ["abc", "def"]
StringUtils.split("abc def", " ") = ["abc", "def"]
StringUtils.split("ab:cd:ef", ":") = ["ab", "cd", "ef"]
str - the String to parse, may be nullseparatorChars - the characters used as the delimiters,public static boolean startWith(String str, String prefix)
str - this strprefix - the suffixCopyright © 2022. All rights reserved.