public class StringUtil
extends cn.hutool.core.util.StrUtil
BACKSLASH, BRACKET_END, BRACKET_START, C_BACKSLASH, C_BRACKET_END, C_BRACKET_START, C_COLON, C_COMMA, C_CR, C_DELIM_END, C_DELIM_START, C_DOT, C_LF, C_SLASH, C_SPACE, C_TAB, C_UNDERLINE, COLON, COMMA, CR, CRLF, DASHED, DELIM_END, DELIM_START, DOT, DOUBLE_DOT, EMPTY, EMPTY_JSON, HTML_AMP, HTML_APOS, HTML_GT, HTML_LT, HTML_NBSP, HTML_QUOTE, INDEX_NOT_FOUND, LF, NULL, SLASH, SPACE, TAB, UNDERLINE| 构造器和说明 |
|---|
StringUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
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 boolean |
equalsAnyIgnoreCase(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, ignoring case. |
static boolean |
isAnyEmpty(CharSequence... css)
Checks if any one of the CharSequences are empty ("") or null.
|
static boolean |
isNoneEmpty(CharSequence... css)
Checks if none of the CharSequences are empty ("") or null.
|
static int |
length(String str)
获取字符串长度
|
static String |
md5(String str)
对String字符串进行MD5加密
|
addPrefixIfNot, addSuffixIfNot, appendIfMissing, appendIfMissing, appendIfMissingIgnoreCase, blankToDefault, brief, builder, builder, builder, byteBuffer, byteLength, bytes, bytes, bytes, center, center, center, cleanBlank, compare, compareIgnoreCase, compareVersion, concat, contains, containsAny, containsAny, containsAnyIgnoreCase, containsBlank, containsIgnoreCase, containsOnly, count, count, cut, emptyToDefault, emptyToNull, endWith, endWith, endWith, endWithAny, endWithIgnoreCase, equals, equals, equalsAny, equalsCharAt, equalsIgnoreCase, fill, fillAfter, fillBefore, format, format, genGetter, genSetter, getContainsStr, getContainsStrIgnoreCase, getGeneralField, getReader, getWriter, hasBlank, hasEmpty, hide, indexedFormat, indexOf, indexOf, indexOf, indexOf, indexOfIgnoreCase, indexOfIgnoreCase, isAllBlank, isAllCharMatch, isAllEmpty, isBlank, isBlankIfStr, isBlankOrUndefined, isEmpty, isEmptyIfStr, isEmptyOrUndefined, isLowerCase, isNotBlank, isNotEmpty, isNullOrUndefined, isSubEquals, isSurround, isSurround, isUpperCase, isWrap, isWrap, isWrap, isWrap, join, lastIndexOf, lastIndexOfIgnoreCase, lastIndexOfIgnoreCase, length, lowerFirst, maxLength, move, nullToDefault, nullToEmpty, ordinalIndexOf, padAfter, padAfter, padPre, padPre, prependIfMissing, prependIfMissing, prependIfMissingIgnoreCase, removeAll, removeAll, removeAllLineBreaks, removePreAndLowerFirst, removePreAndLowerFirst, removePrefix, removePrefixIgnoreCase, removeSufAndLowerFirst, removeSuffix, removeSuffixIgnoreCase, repeat, repeat, repeatAndJoin, repeatByLength, replace, replace, replace, replace, replace, replace, replaceChars, replaceChars, replaceIgnoreCase, reverse, similar, similar, split, split, split, split, split, split, split, splitToArray, splitToArray, splitToInt, splitToInt, splitToLong, splitToLong, splitTrim, splitTrim, splitTrim, splitTrim, startWith, startWith, startWith, startWithAny, startWithIgnoreCase, str, str, str, str, str, str, str, str, str, strBuilder, strBuilder, strBuilder, strip, strip, stripIgnoreCase, stripIgnoreCase, sub, subAfter, subAfter, subBefore, subBefore, subBetween, subBetween, subPre, subPreGbk, subSuf, subSufByLength, subWithLength, swapCase, toCamelCase, toString, toSymbolCase, totalLength, toUnderlineCase, trim, trim, trim, trimEnd, trimStart, trimToEmpty, trimToNull, unWrap, unWrap, unWrap, upperFirst, upperFirstAndAddPre, utf8Bytes, utf8Str, uuid, wrap, wrap, wrapAll, wrapAll, wrapAllIfMissing, wrapAllIfMissing, wrapIfMissingpublic 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 equalsAnyIgnoreCase(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, ignoring case.
StringUtils.equalsAnyIgnoreCase(null, (CharSequence[]) null) = false
StringUtils.equalsAnyIgnoreCase(null, null, null) = true
StringUtils.equalsAnyIgnoreCase(null, "abc", "def") = false
StringUtils.equalsAnyIgnoreCase("abc", null, "def") = false
StringUtils.equalsAnyIgnoreCase("abc", "abc", "def") = true
StringUtils.equalsAnyIgnoreCase("abc", "ABC", "DEF") = true
string - to compare, may be null.searchStrings - a vararg of strings, may be null.true if the string is equal (case-insensitive)
to any other element of searchStrings;
false if searchStrings is null or
contains no matches.public static boolean isAnyEmpty(CharSequence... css)
Checks if any one of the CharSequences are empty ("") or null.
StringUtils.isAnyEmpty(null) = true
StringUtils.isAnyEmpty(null, "foo") = true
StringUtils.isAnyEmpty("", "bar") = true
StringUtils.isAnyEmpty("bob", "") = true
StringUtils.isAnyEmpty(" bob ", null) = true
StringUtils.isAnyEmpty(" ", "bar") = false
StringUtils.isAnyEmpty("foo", "bar") = false
css - the CharSequences to check, may be null or emptytrue if any of the CharSequences are empty or nullpublic static boolean isNoneEmpty(CharSequence... css)
Checks if none of the CharSequences are empty ("") or null.
StringUtils.isNoneEmpty(null) = false
StringUtils.isNoneEmpty(null, "foo") = false
StringUtils.isNoneEmpty("", "bar") = false
StringUtils.isNoneEmpty("bob", "") = false
StringUtils.isNoneEmpty(" bob ", null) = false
StringUtils.isNoneEmpty(" ", "bar") = true
StringUtils.isNoneEmpty("foo", "bar") = true
css - the CharSequences to check, may be null or emptytrue if none of the CharSequences are empty or nullpublic static int length(String str)
str - 字符串Copyright © 2019. All rights reserved.