public class CheckUtil extends Object
| 构造器和说明 |
|---|
CheckUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkLength(String str,
int max)
检查字符串是否不超过多少个字符
|
static boolean |
checkLength(String str,
int min,
int max)
检查字符串字符长度是否在范围内
|
static boolean |
checkRegExp(String str,
String regExp)
是否匹配正则
|
static <T> boolean |
inConstant(Class<T> t,
Object value)
值是否是常量的值之一
|
static boolean |
isChinaName(String str)
是否是中文
|
static boolean |
isIdNumber(String str)
是否是身份证号码
|
static boolean |
isPhoneNumber(String str)
验证字符串是否是手机号码
|
public static boolean isPhoneNumber(@Nonnull String str)
str - 要验证的字符串public static boolean checkRegExp(@Nonnull String str, @Nonnull String regExp)
str - 字符串regExp - 正则public static boolean checkLength(@Nonnull String str, int min, int max)
str - 字符串min - 最小max - 最大public static boolean checkLength(@Nonnull String str, int max)
str - 字符串max - 最大字符Copyright © 2018. All rights reserved.