public class StringUtil
extends cn.hutool.core.util.StrUtil
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| 构造器和说明 |
|---|
StringUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decodeStrToBytes(String str,
EncodingEnum encoding)
字符串解码字节数组,注:此处编码并非utf-8等字符解码;
若需使用字符解码,使用
CharSequenceUtil.bytes(CharSequence, Charset) |
static String |
encodeBytesToStr(byte[] bytes,
EncodingEnum encoding)
字节数组编码字符串,注:此处编码并非utf-8等字符编码;
若需使用字符编码,使用
toStr(Object, Charset) |
static boolean |
isInteger(String strNum)
判断一个字符串是否都为整数
|
static String |
toStr(Object obj)
将obj转为字符串,UTF-8编码
|
static String |
toStr(Object obj,
Charset charset)
将obj转为字符串,指定编码
|
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, uuidaddPrefixIfNot, 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, 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, split, splitToArray, 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, wrapIfMissingpublic static String toStr(Object obj, Charset charset)
obj - objcharset - 编码public static String encodeBytesToStr(byte[] bytes, EncodingEnum encoding)
toStr(Object, Charset)bytes - 字节数组encoding - 编码格式public static byte[] decodeStrToBytes(String str, EncodingEnum encoding)
CharSequenceUtil.bytes(CharSequence, Charset)str - 字符串encoding - 编码格式public static boolean isInteger(String strNum)
strNum - 输入Copyright © 2022. All rights reserved.