public abstract class StringUtils
extends org.apache.commons.lang3.StringUtils
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
areNotEmpty(String... values)
检查指定的字符串列表是否不为空。
|
static boolean |
byteNotNull(byte[] paramArrayOfByte) |
static String |
escapeXml(String value)
XML字符转义包括(<,>,',&,")五个字符.
|
static String |
formatDateTime(Date date)
对日期进行字符串格式化,采用yyyy-MM-dd HH:mm:ss的格式。
|
static String |
formatDateTime(Date date,
String pattern)
对日期进行字符串格式化,采用指定的格式。
|
static Set<String> |
getClassProperties(Class<?> clazz,
boolean isGet)
获取类的get/set属性名称集合。
|
static boolean |
isDigits(String str)
Checks whether the
String contains only
digit characters. |
static boolean |
isEmpty(String value)
检查指定的字符串是否为空。
|
static boolean |
isNumeric(Object obj)
检查对象是否为数字型字符串,包含负数开头的。
|
static boolean |
isValidEmailAddress(String email) |
static Date |
parseDateTime(String str)
把字符串解释为日期对象,采用yyyy-MM-dd HH:mm:ss的格式。
|
static String |
toCamelStyle(String name)
把名称转换为首字母小写的驼峰形式。
|
static String |
toUnderlineStyle(String name)
把名称转换为小写加下划线的形式。
|
static String |
unicodeToChinese(String unicode)
把通用字符编码的字符串转化为汉字编码。
|
abbreviate, abbreviate, 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, getDigits, getFuzzyDistance, getJaroWinklerDistance, getLevenshteinDistance, getLevenshteinDistance, indexOf, indexOf, indexOf, indexOf, indexOfAny, indexOfAny, indexOfAny, indexOfAnyBut, indexOfAnyBut, indexOfDifference, indexOfDifference, indexOfIgnoreCase, indexOfIgnoreCase, isAllBlank, isAllEmpty, isAllLowerCase, isAllUpperCase, isAlpha, isAlphanumeric, isAlphanumericSpace, isAlphaSpace, isAnyBlank, isAnyEmpty, isAsciiPrintable, isBlank, isEmpty, isMixedCase, 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, toCodePoints, toEncodedString, toString, trim, trimToEmpty, trimToNull, truncate, truncate, uncapitalize, unwrap, unwrap, upperCase, upperCase, wrap, wrap, wrapIfMissing, wrapIfMissingpublic static boolean isEmpty(String value)
value - 待检查的字符串public static boolean isNumeric(Object obj)
obj - the objpublic static boolean areNotEmpty(String... values)
values - the valuespublic static String unicodeToChinese(String unicode)
unicode - the unicodepublic static String toUnderlineStyle(String name)
name - the namepublic static String toCamelStyle(String name)
name - the namepublic static Date parseDateTime(String str) throws ParseException
str - the strParseException - the parse exceptionpublic static String formatDateTime(Date date)
date - the datepublic static String formatDateTime(Date date, String pattern)
date - the datepattern - the patternpublic static String escapeXml(String value)
value - 所需转义的字符串public static Set<String> getClassProperties(Class<?> clazz, boolean isGet) throws IntrospectionException
clazz - 类isGet - 是否获取读方法,true为读方法,false为写方法IntrospectionException - the introspection exceptionpublic static boolean isDigits(String str)
Checks whether the String contains only
digit characters.
Null and empty String will return
false.
str - the String to checktrue if str contains only unicode numericpublic static boolean byteNotNull(byte[] paramArrayOfByte)
public static boolean isValidEmailAddress(String email)
Copyright © 2022. All rights reserved.