public final class StrKit extends Object implements StringPoolKit
AMPERSAND, AND, ASTERISK, AT, BACK_SLASH, BACKTICK, BYTES_NEW_LINE, COLON, COMMA, CRLF, DASH, DOLLAR, DOLLAR_LEFT_BRACE, DOT, DOT_CLASS, DOT_JAVA, DOT_NEWLINE, DOT_XML, DOTDOT, EMPTY, EMPTY_ARRAY, EQUALS, EXCLAMATION_MARK, FALSE, HASH, HASH_LEFT_BRACE, HAT, HTML_AMP, HTML_GT, HTML_LT, HTML_NBSP, HTML_QUOTE, ISO_8859_1, LEFT_BRACE, LEFT_BRACKET, LEFT_CHEV, LEFT_SQ_BRACKET, N, NEWLINE, NO, NULL, OFF, ON, ONE, PERCENT, PIPE, PLUS, QUESTION_MARK, QUOTE, RETURN, RIGHT_BRACE, RIGHT_BRACKET, RIGHT_CHEV, RIGHT_SQ_BRACKET, SEMICOLON, SINGLE_QUOTE, SLASH, SPACE, STAR, TAB, TILDA, TRUE, UNDERSCORE, US_ASCII, UTF_8, Y, YES, ZERO| 限定符和类型 | 方法和说明 |
|---|---|
static int[] |
convertCharToInt(char[] c)
将字符数组转为整型数组
|
static String |
defaultIfBlank(String str,
String defaultValue) |
static boolean |
equals(CharSequence cs1,
CharSequence cs2)
Compares two CharSequences, returning
true if they represent
equal sequences of characters. |
static boolean |
equals(String a,
String b) |
static boolean |
equalsAny(CharSequence string,
CharSequence... searchStrings)
Compares given
string to a CharSequences vararg of searchStrings,
returning true if the string is equal to any of the searchStrings. |
static String |
firstCharToLowerCase(String str)
首字母变小写
|
static String |
firstCharToUpperCase(String str)
首字母变大写
|
static String |
getRandomUUID() |
static boolean |
isBlank(String str)
字符串为 null 或者内部字符全部为 ' ' '\t' '\n' '\r' 这四类字符时返回 true
|
static String |
join(List<String> list,
String separator) |
static String |
join(String[] stringArray) |
static String |
join(String[] stringArray,
String separator) |
static boolean |
notBlank(String... strings) |
static boolean |
notBlank(String str) |
static boolean |
notNull(Object... paras) |
static boolean |
slowEquals(String a,
String b) |
static String |
toCamelCase(String stringWithUnderline) |
static Double |
toDouble(String obj) |
static Float |
toFloat(String obj) |
static Integer |
toInteger(String obj) |
static Long |
toLong(String obj) |
public static boolean isBlank(String str)
public static boolean notBlank(String str)
public static boolean notBlank(String... strings)
public static boolean notNull(Object... paras)
public static String getRandomUUID()
public static boolean equalsAny(CharSequence string, CharSequence... searchStrings)
Compares given string to a CharSequences vararg of searchStrings,
returning true if the string is equal to any of the searchStrings.
StringUtils.equalsAny(null, (CharSequence[]) null) = false
StringUtils.equalsAny(null, null, null) = true
StringUtils.equalsAny(null, "abc", "def") = false
StringUtils.equalsAny("abc", null, "def") = false
StringUtils.equalsAny("abc", "abc", "def") = true
StringUtils.equalsAny("abc", "ABC", "DEF") = false
string - to compare, may be null.searchStrings - a vararg of strings, may be null.true if the string is equal (case-sensitive) to any other element of searchStrings;
false if searchStrings is null or contains no matches.public static boolean equals(CharSequence cs1, CharSequence cs2)
Compares two CharSequences, returning true if they represent
equal sequences of characters.
nulls are handled without exceptions. Two null
references are considered to be equal. The comparison is case sensitive.
StringUtils.equals(null, null) = true
StringUtils.equals(null, "abc") = false
StringUtils.equals("abc", null) = false
StringUtils.equals("abc", "abc") = true
StringUtils.equals("abc", "ABC") = false
cs1 - the first CharSequence, may be nullcs2 - the second CharSequence, may be nulltrue if the CharSequences are equal (case-sensitive), or both nullObject.equals(Object)public static int[] convertCharToInt(char[] c)
throws NumberFormatException
c - NumberFormatExceptionCopyright © 2020. All rights reserved.