public class StringUtils
extends cn.hutool.core.util.StrUtil
EMPTY, INDEX_NOT_FOUND, NULL, SPACE
AT, BACKSLASH, BRACKET_END, BRACKET_START, C_AT, 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_JSON, HTML_AMP, HTML_APOS, HTML_GT, HTML_LT, HTML_NBSP, HTML_QUOTE, LF, SLASH, TAB, UNDERLINE
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
deleteFirstEqualString(CharSequence str,
CharSequence prefix)
删除开始相等的字符串
|
static String |
deleteFirstLastEqualString(String str,
String firstStr,
String lastStr)
删除前后相等字符串
|
static String |
deleteFirstLastString(String str,
int length)
删除前后字符串
|
static String |
deleteLastEqualString(CharSequence str,
CharSequence suffix)
删除尾部相等的字符串
|
static boolean |
isEmptys(String[] array)
判断String数组是否为空
|
static boolean |
isNotEmptys(String[] array)
确认String数组不为空
|
static String |
replace(String str,
String replacedStr,
int start,
int end)
替换字符串-根据索引
|
builder, builder, fill, fillAfter, fillBefore, format, format, getReader, getWriter, isBlankIfStr, isEmptyIfStr, reverse, similar, similar, str, str, str, str, str, str, str, str, strBuilder, strBuilder, toString, trim, utf8Str, uuid
addPrefixIfNot, addSuffixIfNot, appendIfMissing, appendIfMissing, appendIfMissingIgnoreCase, blankToDefault, brief, builder, byteBuffer, byteLength, bytes, bytes, bytes, center, center, center, cleanBlank, compare, compareIgnoreCase, compareVersion, concat, contains, contains, containsAny, containsAny, containsAnyIgnoreCase, containsBlank, containsIgnoreCase, containsOnly, count, count, cut, desensitized, emptyIfNull, emptyToDefault, emptyToNull, endWith, endWith, endWith, endWithAny, endWithAnyIgnoreCase, endWithIgnoreCase, equals, equals, equalsAny, equalsAny, equalsAnyIgnoreCase, equalsCharAt, equalsIgnoreCase, filter, firstNonBlank, firstNonEmpty, firstNonNull, format, genGetter, genSetter, getContainsStr, getContainsStrIgnoreCase, getGeneralField, hasBlank, hasEmpty, hide, indexedFormat, indexOf, indexOf, indexOf, indexOf, indexOfIgnoreCase, indexOfIgnoreCase, isAllBlank, isAllCharMatch, isAllEmpty, isAllNotBlank, isAllNotEmpty, isBlank, isBlankOrUndefined, isEmpty, 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, removeAny, removePreAndLowerFirst, removePreAndLowerFirst, removePrefix, removePrefixIgnoreCase, removeSufAndLowerFirst, removeSuffix, removeSuffixIgnoreCase, repeat, repeat, repeatAndJoin, repeatByLength, replace, replace, replace, replace, replace, replace, replaceChars, replaceChars, replaceIgnoreCase, split, split, split, split, split, split, split, splitToArray, splitToArray, splitToInt, splitToInt, splitToLong, splitToLong, splitTrim, splitTrim, splitTrim, splitTrim, startWith, startWith, startWith, startWith, startWithAny, startWithIgnoreCase, startWithIgnoreEquals, str, strBuilder, strip, strip, stripIgnoreCase, stripIgnoreCase, sub, subAfter, subAfter, subBefore, subBefore, subBetween, subBetween, subBetweenAll, subBetweenAll, subByCodePoint, subPre, subPreGbk, subSuf, subSufByLength, subWithLength, swapCase, toCamelCase, toSymbolCase, totalLength, toUnderlineCase, trim, trim, trimEnd, trimStart, trimToEmpty, trimToNull, unWrap, unWrap, unWrap, upperFirst, upperFirstAndAddPre, utf8Bytes, wrap, wrap, wrapAll, wrapAllIfMissing, wrapAllWithPair, wrapAllWithPairIfMissing, wrapIfMissing
public static boolean isEmptys(String[] array)
弱判断,只确定数组中第一个元素是否为空
array
- 要判断的String[]数组public static boolean isNotEmptys(String[] array)
弱判断,只确定数组中第一个元素是否为空
array
- 要判断的String[]数组public static String replace(String str, String replacedStr, int start, int end)
str
- 原始字符串replacedStr
- 替换字符串start
- 开始索引,包括此索引end
- 结束索引,不包括此索引(结束索引==开始索引:将在开始索引处插入替换字符串)public static String deleteFirstEqualString(CharSequence str, CharSequence prefix)
str
- 需要处理的字符串prefix
- 条件public static String deleteLastEqualString(CharSequence str, CharSequence suffix)
str
- 需要处理的字符串suffix
- 条件public static String deleteFirstLastEqualString(String str, String firstStr, String lastStr)
str
- 需要处理的字符串firstStr
- 开始字符串lastStr
- 末尾字符串Copyright © 2022 Pivotal Software, Inc.. All rights reserved.