类 StringUtils
- java.lang.Object
-
- cn.hutool.core.text.CharSequenceUtil
-
- cn.hutool.core.util.StrUtil
-
- ai.yue.library.base.util.StringUtils
-
- 所有已实现的接口:
cn.hutool.core.text.StrPool
public class StringUtils extends cn.hutool.core.util.StrUtilString工具类- 从以下版本开始:
- 2017年10月28日
- 作者:
- ylyue
-
-
字段概要
-
从接口继承的字段 cn.hutool.core.text.StrPool
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
-
-
构造器概要
构造器 构造器 说明 StringUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringdeleteFirstEqualString(CharSequence str, CharSequence prefix)删除开始相等的字符串static StringdeleteFirstLastEqualString(String str, String firstStr, String lastStr)删除前后相等字符串static StringdeleteFirstLastString(String str, int length)删除前后字符串static StringdeleteLastEqualString(CharSequence str, CharSequence suffix)删除尾部相等的字符串static booleanisEmptys(String[] array)判断String数组是否为空static booleanisNotEmptys(String[] array)确认String数组不为空static Stringreplace(String str, String replacedStr, int start, int end)替换字符串-根据索引-
从类继承的方法 cn.hutool.core.util.StrUtil
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
-
从类继承的方法 cn.hutool.core.text.CharSequenceUtil
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
-
-
-
-
方法详细资料
-
isEmptys
public static boolean isEmptys(String[] array)
判断String数组是否为空
弱判断,只确定数组中第一个元素是否为空
- 参数:
array- 要判断的String[]数组- 返回:
- String数组长度==0或者第一个元素为空(true)
-
isNotEmptys
public static boolean isNotEmptys(String[] array)
确认String数组不为空
弱判断,只确定数组中第一个元素是否为空
- 参数:
array- 要判断的String[]数组- 返回:
- String数组长度==0或者第一个元素为空(true)
-
replace
public static String replace(String str, String replacedStr, int start, int end)
替换字符串-根据索引- 参数:
str- 原始字符串replacedStr- 替换字符串start- 开始索引,包括此索引end- 结束索引,不包括此索引(结束索引==开始索引:将在开始索引处插入替换字符串)- 返回:
- 替换后的字符串
-
deleteFirstEqualString
public static String deleteFirstEqualString(CharSequence str, CharSequence prefix)
删除开始相等的字符串- 参数:
str- 需要处理的字符串prefix- 条件- 返回:
- 删除后的StringBuffer
-
deleteLastEqualString
public static String deleteLastEqualString(CharSequence str, CharSequence suffix)
删除尾部相等的字符串- 参数:
str- 需要处理的字符串suffix- 条件- 返回:
- 删除后的字符串
-
deleteFirstLastEqualString
public static String deleteFirstLastEqualString(String str, String firstStr, String lastStr)
删除前后相等字符串- 参数:
str- 需要处理的字符串firstStr- 开始字符串lastStr- 末尾字符串- 返回:
- 删除后的字符串
-
-