how2j.cn

步骤 1 : StrUtil   
步骤 2 : 与空判断相关的   
步骤 3 : 头尾处理   
步骤 4 : 包含与否   
步骤 5 : setter gettter 处理   
步骤 6 : 删除   
步骤 7 : 大小写   
步骤 8 : 分割   
步骤 9 : 截取   
步骤 10 : 创建字符串   
步骤 11 : 是否相等   
步骤 12 : 格式化   
步骤 13 : 获取字节   
步骤 14 : 转换为字符串   
步骤 15 : 格式转换   
步骤 16 : 包裹   
步骤 17 : 填充   
步骤 18 : 获取其他对象   
步骤 19 : 出现次数   
步骤 20 : 摘要和隐藏   
步骤 21 : 比较   
步骤 22 : 获取索引位置   
步骤 23 : 追加   
步骤 24 : 替换   
步骤 25 : 相似度   
步骤 26 : 其他   

StrUtil 功能很强大,里面提供了很多很多字符串相关的操作。
站长对这些方法做了分门别类的整理,方便大家使用的时候查询。

这些方法的命名都很规范,一眼就知道是干什么用的。 实在还是不太明白,可以再查api.
其实一般是反过来的,就是工作上需要用到什么,再到这里来看看是否有提供相关现成的功能。
步骤 2 :

与空判断相关的

edit
public static boolean isBlank(CharSequence str) public static boolean isBlankIfStr(Object obj) public static boolean isNotBlank(CharSequence str) public static boolean hasBlank(CharSequence... strs) public static boolean isAllBlank(CharSequence... strs) public static boolean isEmpty(CharSequence str) public static boolean isEmptyIfStr(Object obj) public static boolean isNotEmpty(CharSequence str) public static String nullToEmpty(CharSequence str) public static String nullToDefault(CharSequence str, String defaultStr) public static String emptyToDefault(CharSequence str, String defaultStr) public static String blankToDefault(CharSequence str, String defaultStr) public static String emptyToNull(CharSequence str) public static boolean hasEmpty(CharSequence... strs) public static boolean isAllEmpty(CharSequence... strs) public static boolean isNullOrUndefined(CharSequence str) public static boolean isEmptyOrUndefined(CharSequence str) public static boolean isBlankOrUndefined(CharSequence str) public static String cleanBlank(CharSequence str)
public static boolean isBlank(CharSequence str) 
public static boolean isBlankIfStr(Object obj) 
public static boolean isNotBlank(CharSequence str) 
public static boolean hasBlank(CharSequence... strs) 
public static boolean isAllBlank(CharSequence... strs) 
public static boolean isEmpty(CharSequence str) 
public static boolean isEmptyIfStr(Object obj) 
public static boolean isNotEmpty(CharSequence str) 
public static String nullToEmpty(CharSequence str) 
public static String nullToDefault(CharSequence str, String defaultStr) 
public static String emptyToDefault(CharSequence str, String defaultStr) 
public static String blankToDefault(CharSequence str, String defaultStr) 
public static String emptyToNull(CharSequence str) 
public static boolean hasEmpty(CharSequence... strs) 
public static boolean isAllEmpty(CharSequence... strs) 
public static boolean isNullOrUndefined(CharSequence str) 
public static boolean isEmptyOrUndefined(CharSequence str) 
public static boolean isBlankOrUndefined(CharSequence str) 
public static String cleanBlank(CharSequence str) 
public static String trim(CharSequence str) public static void trim(String[] strs) public static String trimToEmpty(CharSequence str) public static String trimToNull(CharSequence str) public static String trimStart(CharSequence str) public static String trimEnd(CharSequence str) public static String trim(CharSequence str, int mode) public static String strip(CharSequence str, CharSequence prefixOrSuffix) public static String strip(CharSequence str, CharSequence prefix, CharSequence suffix) public static String stripIgnoreCase(CharSequence str, CharSequence prefixOrSuffix) public static String stripIgnoreCase(CharSequence str, CharSequence prefix, CharSequence suffix) public static String addPrefixIfNot(CharSequence str, CharSequence prefix) public static String addSuffixIfNot(CharSequence str, CharSequence suffix) public static boolean isSurround(CharSequence str, CharSequence prefix, CharSequence suffix) public static boolean isSurround(CharSequence str, char prefix, char suffix)
public static String trim(CharSequence str) 
public static void trim(String[] strs) 
public static String trimToEmpty(CharSequence str) 
public static String trimToNull(CharSequence str) 
public static String trimStart(CharSequence str) 
public static String trimEnd(CharSequence str) 
public static String trim(CharSequence str, int mode) 
public static String strip(CharSequence str, CharSequence prefixOrSuffix) 
public static String strip(CharSequence str, CharSequence prefix, CharSequence suffix) 
public static String stripIgnoreCase(CharSequence str, CharSequence prefixOrSuffix) 
public static String stripIgnoreCase(CharSequence str, CharSequence prefix, CharSequence suffix) 
public static String addPrefixIfNot(CharSequence str, CharSequence prefix) 
public static String addSuffixIfNot(CharSequence str, CharSequence suffix) 
public static boolean isSurround(CharSequence str, CharSequence prefix, CharSequence suffix) 
public static boolean isSurround(CharSequence str, char prefix, char suffix) 
public static boolean startWith(CharSequence str, char c) public static boolean startWith(CharSequence str, CharSequence prefix, boolean isIgnoreCase) public static boolean startWith(CharSequence str, CharSequence prefix) public static boolean startWithIgnoreCase(CharSequence str, CharSequence prefix) public static boolean startWithAny(CharSequence str, CharSequence... prefixes) public static boolean endWith(CharSequence str, char c) public static boolean endWith(CharSequence str, CharSequence suffix, boolean isIgnoreCase) public static boolean endWith(CharSequence str, CharSequence suffix) public static boolean endWithIgnoreCase(CharSequence str, CharSequence suffix) public static boolean endWithAny(CharSequence str, CharSequence... suffixes) public static boolean contains(CharSequence str, char searchChar) public static boolean containsAny(CharSequence str, CharSequence... testStrs) public static boolean containsAny(CharSequence str, char... testChars) public static boolean containsBlank(CharSequence str) public static String getContainsStr(CharSequence str, CharSequence... testStrs) public static boolean containsIgnoreCase(CharSequence str, CharSequence testStr) public static boolean containsAnyIgnoreCase(CharSequence str, CharSequence... testStrs) public static String getContainsStrIgnoreCase(CharSequence str, CharSequence... testStrs)
public static boolean startWith(CharSequence str, char c) 
public static boolean startWith(CharSequence str, CharSequence prefix, boolean isIgnoreCase) 
public static boolean startWith(CharSequence str, CharSequence prefix) 
public static boolean startWithIgnoreCase(CharSequence str, CharSequence prefix) 
public static boolean startWithAny(CharSequence str, CharSequence... prefixes) 
public static boolean endWith(CharSequence str, char c) 
public static boolean endWith(CharSequence str, CharSequence suffix, boolean isIgnoreCase) 
public static boolean endWith(CharSequence str, CharSequence suffix) 
public static boolean endWithIgnoreCase(CharSequence str, CharSequence suffix) 
public static boolean endWithAny(CharSequence str, CharSequence... suffixes) 
public static boolean contains(CharSequence str, char searchChar) 
public static boolean containsAny(CharSequence str, CharSequence... testStrs) 
public static boolean containsAny(CharSequence str, char... testChars) 
public static boolean containsBlank(CharSequence str) 
public static String getContainsStr(CharSequence str, CharSequence... testStrs) 
public static boolean containsIgnoreCase(CharSequence str, CharSequence testStr) 
public static boolean containsAnyIgnoreCase(CharSequence str, CharSequence... testStrs) 
public static String getContainsStrIgnoreCase(CharSequence str, CharSequence... testStrs)
步骤 5 :

setter gettter 处理

edit
public static String getGeneralField(CharSequence getOrSetMethodName) public static String genSetter(CharSequence fieldName) public static String genGetter(CharSequence fieldName)
public static String getGeneralField(CharSequence getOrSetMethodName) 
public static String genSetter(CharSequence fieldName) 
public static String genGetter(CharSequence fieldName) 
public static String removeAll(CharSequence str, CharSequence strToRemove) public static String removeAll(CharSequence str, char... chars) public static String removeAllLineBreaks(CharSequence str) public static String removePreAndLowerFirst(CharSequence str, int preLength) public static String removePreAndLowerFirst(CharSequence str, CharSequence prefix) public static String removePrefix(CharSequence str, CharSequence prefix) public static String removePrefixIgnoreCase(CharSequence str, CharSequence prefix) public static String removeSuffix(CharSequence str, CharSequence suffix) public static String removeSufAndLowerFirst(CharSequence str, CharSequence suffix) public static String removeSuffixIgnoreCase(CharSequence str, CharSequence suffix)
public static String removeAll(CharSequence str, CharSequence strToRemove) 
public static String removeAll(CharSequence str, char... chars) 
public static String removeAllLineBreaks(CharSequence str) 
public static String removePreAndLowerFirst(CharSequence str, int preLength) 
public static String removePreAndLowerFirst(CharSequence str, CharSequence prefix) 
public static String removePrefix(CharSequence str, CharSequence prefix) 
public static String removePrefixIgnoreCase(CharSequence str, CharSequence prefix) 
public static String removeSuffix(CharSequence str, CharSequence suffix) 
public static String removeSufAndLowerFirst(CharSequence str, CharSequence suffix) 
public static String removeSuffixIgnoreCase(CharSequence str, CharSequence suffix) 
public static String upperFirstAndAddPre(CharSequence str, String preString) public static String upperFirst(CharSequence str) public static String lowerFirst(CharSequence str) public static boolean isUpperCase(CharSequence str) public static boolean isLowerCase(CharSequence str)
public static String upperFirstAndAddPre(CharSequence str, String preString) 
public static String upperFirst(CharSequence str) 
public static String lowerFirst(CharSequence str) 
public static boolean isUpperCase(CharSequence str) 
public static boolean isLowerCase(CharSequence str) 
public static String[] splitToArray(CharSequence str, char separator) public static long[] splitToLong(CharSequence str, char separator) public static long[] splitToLong(CharSequence str, CharSequence separator) public static int[] splitToInt(CharSequence str, char separator) public static int[] splitToInt(CharSequence str, CharSequence separator) public static List<String> split(CharSequence str, char separator) public static String[] splitToArray(CharSequence str, char separator, int limit) public static List<String> split(CharSequence str, char separator, int limit) public static List<String> splitTrim(CharSequence str, char separator) public static List<String> splitTrim(CharSequence str, CharSequence separator) public static List<String> splitTrim(CharSequence str, char separator, int limit) public static List<String> splitTrim(CharSequence str, CharSequence separator, int limit) public static List<String> split(CharSequence str, char separator, boolean isTrim, boolean ignoreEmpty) public static List<String> split(CharSequence str, char separator, int limit, boolean isTrim, boolean ignoreEmpty) public static List<String> split(CharSequence str, CharSequence separator, int limit, boolean isTrim, boolean ignoreEmpty) public static String[] split(CharSequence str, CharSequence separator) public static String[] split(CharSequence str, int len) public static String[] cut(CharSequence str, int partLength)
public static String[] splitToArray(CharSequence str, char separator) 
public static long[] splitToLong(CharSequence str, char separator) 
public static long[] splitToLong(CharSequence str, CharSequence separator) 
public static int[] splitToInt(CharSequence str, char separator) 
public static int[] splitToInt(CharSequence str, CharSequence separator) 
public static List<String> split(CharSequence str, char separator) 
public static String[] splitToArray(CharSequence str, char separator, int limit) 
public static List<String> split(CharSequence str, char separator, int limit) 
public static List<String> splitTrim(CharSequence str, char separator) 
public static List<String> splitTrim(CharSequence str, CharSequence separator) 
public static List<String> splitTrim(CharSequence str, char separator, int limit) 
public static List<String> splitTrim(CharSequence str, CharSequence separator, int limit) 
public static List<String> split(CharSequence str, char separator, boolean isTrim, boolean ignoreEmpty) 
public static List<String> split(CharSequence str, char separator, int limit, boolean isTrim, boolean ignoreEmpty) 
public static List<String> split(CharSequence str, CharSequence separator, int limit, boolean isTrim, boolean ignoreEmpty) 
public static String[] split(CharSequence str, CharSequence separator) 
public static String[] split(CharSequence str, int len) 
public static String[] cut(CharSequence str, int partLength) 
public static String sub(CharSequence str, int fromIndex, int toIndex) public static String subPreGbk(CharSequence str, int len, CharSequence suffix) public static String maxLength(CharSequence string, int length) public static String subPre(CharSequence string, int toIndex) public static String subSuf(CharSequence string, int fromIndex) public static String subSufByLength(CharSequence string, int length) public static String subWithLength(String input, int fromIndex, int length) public static String subBefore(CharSequence string, CharSequence separator, boolean isLastSeparator) public static String subBefore(CharSequence string, char separator, boolean isLastSeparator) public static String subAfter(CharSequence string, CharSequence separator, boolean isLastSeparator) public static String subAfter(CharSequence string, char separator, boolean isLastSeparator) public static String subBetween(CharSequence str, CharSequence before, CharSequence after) public static String subBetween(CharSequence str, CharSequence beforeAndAfter)
public static String sub(CharSequence str, int fromIndex, int toIndex) 
public static String subPreGbk(CharSequence str, int len, CharSequence suffix) 
public static String maxLength(CharSequence string, int length) 
public static String subPre(CharSequence string, int toIndex) 
public static String subSuf(CharSequence string, int fromIndex) 
public static String subSufByLength(CharSequence string, int length) 
public static String subWithLength(String input, int fromIndex, int length) 
public static String subBefore(CharSequence string, CharSequence separator, boolean isLastSeparator) 
public static String subBefore(CharSequence string, char separator, boolean isLastSeparator) 
public static String subAfter(CharSequence string, CharSequence separator, boolean isLastSeparator) 
public static String subAfter(CharSequence string, char separator, boolean isLastSeparator) 
public static String subBetween(CharSequence str, CharSequence before, CharSequence after) 
public static String subBetween(CharSequence str, CharSequence beforeAndAfter)
public static String repeat(char c, int count) public static String repeat(CharSequence str, int count) public static String repeatAndJoin(CharSequence str, int count, CharSequence conjunction)
public static String repeat(char c, int count) 
public static String repeat(CharSequence str, int count) 
public static String repeatAndJoin(CharSequence str, int count, CharSequence conjunction) 
public static boolean equals(CharSequence str1, CharSequence str2) public static boolean equalsIgnoreCase(CharSequence str1, CharSequence str2) public static boolean equals(CharSequence str1, CharSequence str2, boolean ignoreCase) public static boolean isSubEquals(CharSequence str1, int start1, CharSequence str2, int start2, int length, boolean ignoreCase) public static boolean isAllCharMatch(CharSequence value, Matcher<Character> matcher) public static boolean equalsCharAt(CharSequence str, int position, char c)
public static boolean equals(CharSequence str1, CharSequence str2) 
public static boolean equalsIgnoreCase(CharSequence str1, CharSequence str2) 
public static boolean equals(CharSequence str1, CharSequence str2, boolean ignoreCase) 
public static boolean isSubEquals(CharSequence str1, int start1, CharSequence str2, int start2, int length, boolean ignoreCase) 
public static boolean isAllCharMatch(CharSequence value, Matcher<Character> matcher) 
public static boolean equalsCharAt(CharSequence str, int position, char c) 
public static String format(CharSequence template, Object... params) public static String indexedFormat(CharSequence pattern, Object... arguments) public static String format(CharSequence template, Map<?, ?> map)
public static String format(CharSequence template, Object... params) 
public static String indexedFormat(CharSequence pattern, Object... arguments) 
public static String format(CharSequence template, Map<?, ?> map) 
public static byte[] utf8Bytes(CharSequence str) public static byte[] bytes(CharSequence str) public static byte[] bytes(CharSequence str, String charset) public static byte[] bytes(CharSequence str, Charset charset)
public static byte[] utf8Bytes(CharSequence str) 
public static byte[] bytes(CharSequence str) 
public static byte[] bytes(CharSequence str, String charset) 
public static byte[] bytes(CharSequence str, Charset charset) 
步骤 14 :

转换为字符串

edit
public static String utf8Str(Object obj) public static String str(Object obj, String charsetName) public static String str(Object obj, Charset charset) public static String str(byte[] bytes, String charset) public static String str(byte[] data, Charset charset) public static String str(Byte[] bytes, String charset) public static String str(Byte[] data, Charset charset) public static String str(ByteBuffer data, String charset) public static String str(ByteBuffer data, Charset charset) public static String str(CharSequence cs) public static String toString(Object obj) public static String join(CharSequence conjunction, Object... objs)
public static String utf8Str(Object obj) 
public static String str(Object obj, String charsetName) 
public static String str(Object obj, Charset charset) 
public static String str(byte[] bytes, String charset) 
public static String str(byte[] data, Charset charset) 
public static String str(Byte[] bytes, String charset) 
public static String str(Byte[] data, Charset charset) 
public static String str(ByteBuffer data, String charset) 
public static String str(ByteBuffer data, Charset charset) 
public static String str(CharSequence cs) 
public static String toString(Object obj) 
public static String join(CharSequence conjunction, Object... objs) 
public static String toUnderlineCase(CharSequence str) public static String toSymbolCase(CharSequence str, char symbol) public static String toCamelCase(CharSequence name)
public static String toUnderlineCase(CharSequence str) 
public static String toSymbolCase(CharSequence str, char symbol) 
public static String toCamelCase(CharSequence name) 
public static String wrap(CharSequence str, CharSequence prefixAndSuffix) public static String wrap(CharSequence str, CharSequence prefix, CharSequence suffix) public static String[] wrapAll(CharSequence prefixAndSuffix, CharSequence... strs) public static String[] wrapAll(CharSequence prefix, CharSequence suffix, CharSequence... strs) public static String wrapIfMissing(CharSequence str, CharSequence prefix, CharSequence suffix) public static String[] wrapAllIfMissing(CharSequence prefixAndSuffix, CharSequence... strs) public static String[] wrapAllIfMissing(CharSequence prefix, CharSequence suffix, CharSequence... strs) public static String unWrap(CharSequence str, String prefix, String suffix) public static String unWrap(CharSequence str, char prefix, char suffix) public static String unWrap(CharSequence str, char prefixAndSuffix) public static boolean isWrap(CharSequence str, String prefix, String suffix) public static boolean isWrap(CharSequence str, String wrapper) public static boolean isWrap(CharSequence str, char wrapper) public static boolean isWrap(CharSequence str, char prefixChar, char suffixChar)
public static String wrap(CharSequence str, CharSequence prefixAndSuffix) 
public static String wrap(CharSequence str, CharSequence prefix, CharSequence suffix) 
public static String[] wrapAll(CharSequence prefixAndSuffix, CharSequence... strs) 
public static String[] wrapAll(CharSequence prefix, CharSequence suffix, CharSequence... strs) 
public static String wrapIfMissing(CharSequence str, CharSequence prefix, CharSequence suffix) 
public static String[] wrapAllIfMissing(CharSequence prefixAndSuffix, CharSequence... strs) 
public static String[] wrapAllIfMissing(CharSequence prefix, CharSequence suffix, CharSequence... strs) 

public static String unWrap(CharSequence str, String prefix, String suffix) 
public static String unWrap(CharSequence str, char prefix, char suffix) 
public static String unWrap(CharSequence str, char prefixAndSuffix) 
public static boolean isWrap(CharSequence str, String prefix, String suffix) 
public static boolean isWrap(CharSequence str, String wrapper) 
public static boolean isWrap(CharSequence str, char wrapper) 
public static boolean isWrap(CharSequence str, char prefixChar, char suffixChar) 
public static String padPre(CharSequence str, int minLength, char padChar) public static String padEnd(CharSequence str, int minLength, char padChar) public static StringBuilder builder() public static String fillBefore(String str, char filledChar, int len) public static String fillAfter(String str, char filledChar, int len) public static String fill(String str, char filledChar, int len, boolean isPre)
public static String padPre(CharSequence str, int minLength, char padChar) 
public static String padEnd(CharSequence str, int minLength, char padChar) 
public static StringBuilder builder() 
public static String fillBefore(String str, char filledChar, int len) 
public static String fillAfter(String str, char filledChar, int len) 
public static String fill(String str, char filledChar, int len, boolean isPre) 
步骤 18 :

获取其他对象

edit
public static StrBuilder strBuilder() public static StringBuilder builder(int capacity) public static StrBuilder strBuilder(int capacity) public static StringBuilder builder(CharSequence... strs) public static StrBuilder strBuilder(CharSequence... strs) public static StringReader getReader(CharSequence str) public static StringWriter getWriter()
public static StrBuilder strBuilder() 
public static StringBuilder builder(int capacity) 
public static StrBuilder strBuilder(int capacity) 
public static StringBuilder builder(CharSequence... strs) 
public static StrBuilder strBuilder(CharSequence... strs) 
public static StringReader getReader(CharSequence str) 
public static StringWriter getWriter() 
public static int count(CharSequence content, CharSequence strForSearch) public static int count(CharSequence content, char charForSearch)
public static int count(CharSequence content, CharSequence strForSearch) 
public static int count(CharSequence content, char charForSearch)
public static String brief(CharSequence str, int maxLength) public static String hide(CharSequence str, int startInclude, int endExclude)
public static String brief(CharSequence str, int maxLength) 
public static String hide(CharSequence str, int startInclude, int endExclude) 
public static int compare(final CharSequence str1, final CharSequence str2, final boolean nullIsLess) public static int compareIgnoreCase(CharSequence str1, CharSequence str2, boolean nullIsLess) public static int compareVersion(CharSequence version1, CharSequence version2)
public static int compare(final CharSequence str1, final CharSequence str2, final boolean nullIsLess) 
public static int compareIgnoreCase(CharSequence str1, CharSequence str2, boolean nullIsLess) 
public static int compareVersion(CharSequence version1, CharSequence version2) 
步骤 22 :

获取索引位置

edit
public static int indexOf(final CharSequence str, char searchChar) public static int indexOf(final CharSequence str, char searchChar, int start) public static int indexOf(final CharSequence str, char searchChar, int start, int end) public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int fromIndex) public static int indexOf(final CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int fromIndex) public static int lastIndexOf(final CharSequence str, final CharSequence searchStr, int fromIndex, boolean ignoreCase) public static int ordinalIndexOf(String str, String searchStr, int ordinal)
public static int indexOf(final CharSequence str, char searchChar) 
public static int indexOf(final CharSequence str, char searchChar, int start) 
public static int indexOf(final CharSequence str, char searchChar, int start, int end) 
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) 
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int fromIndex) 
public static int indexOf(final CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) 
public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) 
public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int fromIndex) 
public static int lastIndexOf(final CharSequence str, final CharSequence searchStr, int fromIndex, boolean ignoreCase) 
public static int ordinalIndexOf(String str, String searchStr, int ordinal) 
public static String appendIfMissing(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) public static String appendIfMissingIgnoreCase(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) public static String appendIfMissing(final CharSequence str, final CharSequence suffix, final boolean ignoreCase, final CharSequence... suffixes) public static String prependIfMissing(final CharSequence str, final CharSequence prefix, final CharSequence... prefixes) public static String prependIfMissingIgnoreCase(final CharSequence str, final CharSequence prefix, final CharSequence... prefixes) public static String prependIfMissing(final CharSequence str, final CharSequence prefix, final boolean ignoreCase, final CharSequence... prefixes)
public static String appendIfMissing(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) 
public static String appendIfMissingIgnoreCase(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) 
public static String appendIfMissing(final CharSequence str, final CharSequence suffix, final boolean ignoreCase, final CharSequence... suffixes) 
public static String prependIfMissing(final CharSequence str, final CharSequence prefix, final CharSequence... prefixes) 
public static String prependIfMissingIgnoreCase(final CharSequence str, final CharSequence prefix, final CharSequence... prefixes) 
public static String prependIfMissing(final CharSequence str, final CharSequence prefix, final boolean ignoreCase, final CharSequence... prefixes) 
public static String replaceIgnoreCase(CharSequence str, CharSequence searchStr, CharSequence replacement) public static String replace(CharSequence str, CharSequence searchStr, CharSequence replacement) public static String replace(CharSequence str, CharSequence searchStr, CharSequence replacement, boolean ignoreCase) public static String replace(CharSequence str, int fromIndex, CharSequence searchStr, CharSequence replacement, boolean ignoreCase) public static String replace(CharSequence str, int startInclude, int endExclude, char replacedChar) public static String replace(CharSequence str, Pattern pattern, Func1<java.util.regex.Matcher, String> replaceFun) public static String replace(CharSequence str, String regex, Func1<java.util.regex.Matcher, String> replaceFun) public static String replaceChars(CharSequence str, String chars, CharSequence replacedStr) public static String replaceChars(CharSequence str, char[] chars, CharSequence replacedStr)
public static String replaceIgnoreCase(CharSequence str, CharSequence searchStr, CharSequence replacement) 
public static String replace(CharSequence str, CharSequence searchStr, CharSequence replacement) 
public static String replace(CharSequence str, CharSequence searchStr, CharSequence replacement, boolean ignoreCase) 
public static String replace(CharSequence str, int fromIndex, CharSequence searchStr, CharSequence replacement, boolean ignoreCase) 
public static String replace(CharSequence str, int startInclude, int endExclude, char replacedChar) 
public static String replace(CharSequence str, Pattern pattern, Func1<java.util.regex.Matcher, String> replaceFun) 
public static String replace(CharSequence str, String regex, Func1<java.util.regex.Matcher, String> replaceFun) 
public static String replaceChars(CharSequence str, String chars, CharSequence replacedStr) 
public static String replaceChars(CharSequence str, char[] chars, CharSequence replacedStr) 
public static double similar(String str1, String str2) public static String similar(String str1, String str2, int scale)
public static double similar(String str1, String str2) 
public static String similar(String str1, String str2, int scale) 
总长度 public static int totalLength(CharSequence... strs) 移动 public static String move(CharSequence str, int startInclude, int endExclude, int moveLength) uuid public static String uuid() 连接 public static String concat(boolean isNullToEmpty, CharSequence... strs) 反转 public static String reverse(String str)
总长度
public static int totalLength(CharSequence... strs) 
移动
public static String move(CharSequence str, int startInclude, int endExclude, int moveLength) 
uuid
public static String uuid() 
连接
public static String concat(boolean isNullToEmpty, CharSequence... strs) 
反转
public static String reverse(String str) 


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


问答区域    
2019-02-14 获取索引位置 的lastIndexOf方法是不是有错误??
李上网来



获取索引位置 的lastIndexOf方法是不是有错误?? 截图中 for循环中 i为什么不能等于0啊? 不能等于0,就会出现索引位置为0时,显示的结果是-1

							

							





回答已经提交成功,正在审核。 请于 我的回答 处查看回答记录,谢谢
答案 或者 代码至少填写一项, 如果是自己有问题,请重新提问,否则站长有可能看不到





2019-02-14 获取索引位置 的lastIndexOf方法是不是有错误??
李上网来



获取索引位置 的lastIndexOf方法是不是有错误?? 截图中 for循环中 i为什么不能等于0啊? 不能等于0,就会出现索引位置为0时,显示的结果是-1

							

							





回答已经提交成功,正在审核。 请于 我的回答 处查看回答记录,谢谢
答案 或者 代码至少填写一项, 如果是自己有问题,请重新提问,否则站长有可能看不到









提问之前请登陆
提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢
关于 JAVA 应用-hutool-字符串工具 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 881555796
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图