public class StringUtil
extends org.apache.commons.lang3.StringUtils
| 构造器和说明 |
|---|
StringUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkStringLength(String str,
int length,
boolean allowNull)
判断字符串是否超长
|
static String |
filterAllSpace(String str)
去除所有空格
|
static String |
filterSearchKey(String str,
String... filterKey)
关键字去空格及过滤
|
static String |
filterSpace(String str)
去除两端空格
|
static String |
firstCharacterToUpper(String srcStr)
首字母大写
|
static String |
getUUIDForLength(int length)
生成length位随机UUID随机主键 不得超过32位或小于1,不满足条件默认返回32位长度
|
static boolean |
isAllBlank(Object... param)
是否全部参数都为空
|
static boolean |
isBlank(Object... param)
是否包含参数值为空的数据
|
static boolean |
isContainChinese(String str)
字符串是否包含中文
|
static String |
likeSearch(String key,
int type,
String... filterKey)
关键字 模糊查询
|
static String |
relaceUnderline(String str)
替换下划线 并且把下划线后的第一个单词大写
|
static String |
relaceUnderline(String[] str)
替换下划线 并且把下划线后的第一个单词大写
|
static String |
removeFormat(String str)
删除格式
|
static String |
replaceColonToEnglish(String str)
如果字符串中有中文的冒号 替换为英文的冒号
|
static String |
replaceSemicolonToEnglish(String str)
如果字符串中有中文的分号 替换为英文的分号
|
abbreviate, abbreviate, abbreviateMiddle, appendIfMissing, appendIfMissingIgnoreCase, capitalize, center, center, center, chomp, chomp, chop, compare, compare, compareIgnoreCase, compareIgnoreCase, contains, contains, containsAny, containsAny, containsAny, containsIgnoreCase, containsNone, containsNone, containsOnly, containsOnly, containsWhitespace, countMatches, countMatches, defaultIfBlank, defaultIfEmpty, defaultString, defaultString, deleteWhitespace, difference, endsWith, endsWithAny, endsWithIgnoreCase, equals, equalsAny, equalsAnyIgnoreCase, equalsIgnoreCase, getCommonPrefix, getFuzzyDistance, getJaroWinklerDistance, getLevenshteinDistance, getLevenshteinDistance, indexOf, indexOf, indexOf, indexOf, indexOfAny, indexOfAny, indexOfAny, indexOfAnyBut, indexOfAnyBut, indexOfDifference, indexOfDifference, indexOfIgnoreCase, indexOfIgnoreCase, isAllLowerCase, isAllUpperCase, isAlpha, isAlphanumeric, isAlphanumericSpace, isAlphaSpace, isAnyBlank, isAnyEmpty, isAsciiPrintable, isBlank, isEmpty, isNoneBlank, isNoneEmpty, isNotBlank, isNotEmpty, isNumeric, isNumericSpace, isWhitespace, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, joinWith, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOfAny, lastIndexOfIgnoreCase, lastIndexOfIgnoreCase, lastOrdinalIndexOf, left, leftPad, leftPad, leftPad, length, lowerCase, lowerCase, mid, normalizeSpace, ordinalIndexOf, overlay, prependIfMissing, prependIfMissingIgnoreCase, remove, remove, removeAll, removeEnd, removeEndIgnoreCase, removeFirst, removeIgnoreCase, removePattern, removeStart, removeStartIgnoreCase, repeat, repeat, repeat, replace, replace, replaceAll, replaceChars, replaceChars, replaceEach, replaceEachRepeatedly, replaceFirst, replaceIgnoreCase, replaceIgnoreCase, replaceOnce, replaceOnceIgnoreCase, replacePattern, reverse, reverseDelimited, right, rightPad, rightPad, rightPad, rotate, split, split, split, split, splitByCharacterType, splitByCharacterTypeCamelCase, splitByWholeSeparator, splitByWholeSeparator, splitByWholeSeparatorPreserveAllTokens, splitByWholeSeparatorPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, startsWith, startsWithAny, startsWithIgnoreCase, strip, strip, stripAccents, stripAll, stripAll, stripEnd, stripStart, stripToEmpty, stripToNull, substring, substring, substringAfter, substringAfterLast, substringBefore, substringBeforeLast, substringBetween, substringBetween, substringsBetween, swapCase, toEncodedString, toString, trim, trimToEmpty, trimToNull, truncate, truncate, uncapitalize, upperCase, upperCase, wrap, wrap, wrapIfMissing, wrapIfMissingpublic static boolean isBlank(Object... param)
param - 需要检查的为空的参数们public static boolean isAllBlank(Object... param)
param - 需要检查的为空的参数们public static String filterSearchKey(String str, String... filterKey)
str - filterKey - public static String likeSearch(String key, int type, String... filterKey)
key - type - -1 为%key 0为 %key% 1为key% 其他默认为0public static String getUUIDForLength(int length)
public static String replaceSemicolonToEnglish(String str)
str - public static String replaceColonToEnglish(String str)
str - public static boolean checkStringLength(String str, int length, boolean allowNull)
str - 待定字符串length - 长度allowNull - 是否可以为空public static String relaceUnderline(String str)
str - public static String relaceUnderline(String[] str)
str - public static String firstCharacterToUpper(String srcStr)
srcStr - public static boolean isContainChinese(String str)
str - 待校验字符串Copyright © 2019. All rights reserved.