public class PhoneUtil extends Object
Constructor and Description |
---|
PhoneUtil() |
Modifier and Type | Method and Description |
---|---|
static CharSequence |
hideAfter(CharSequence phone)
隐藏手机号最后4位 替换字符为"*"
|
static CharSequence |
hideBefore(CharSequence phone)
隐藏手机号前7位 替换字符为"*"
栗子
|
static CharSequence |
hideBetween(CharSequence phone)
隐藏手机号中间4位 替换字符为"*"
|
static boolean |
isMobile(CharSequence value)
验证是否为手机号码(中国大陆)
|
static boolean |
isMobileHk(CharSequence value)
验证是否为手机号码(中国香港)
|
static boolean |
isMobileMo(CharSequence value)
验证是否为手机号码(中国澳门)
|
static boolean |
isMobileTw(CharSequence value)
验证是否为手机号码(中国台湾)
|
static boolean |
isPhone(CharSequence value)
验证是否为座机号码+手机号码(CharUtil中国)+ 400 + 800电话 + 手机号号码(中国香港)
|
static boolean |
isTel(CharSequence value)
验证是否为座机号码(中国大陆)
|
static boolean |
isTel400800(CharSequence value)
验证是否为座机号码(中国大陆)+ 400 + 800
|
static CharSequence |
subAfter(CharSequence phone)
获取手机号后4位
|
static CharSequence |
subBefore(CharSequence phone)
获取手机号前3位
|
static CharSequence |
subBetween(CharSequence phone)
获取手机号中间4位
|
static CharSequence |
subTelAfter(CharSequence value)
获取固话号码中的号码
|
static CharSequence |
subTelBefore(CharSequence value)
获取固话号码中的区号
|
public static boolean isMobile(CharSequence value)
value
- 值public static boolean isMobileHk(CharSequence value)
value
- 手机号码public static boolean isMobileTw(CharSequence value)
value
- 手机号码public static boolean isMobileMo(CharSequence value)
value
- 手机号码public static boolean isTel(CharSequence value)
value
- 值public static boolean isTel400800(CharSequence value)
value
- 值public static boolean isPhone(CharSequence value)
value
- 值public static CharSequence hideBefore(CharSequence phone)
phone
- 手机号码public static CharSequence hideBetween(CharSequence phone)
phone
- 手机号码public static CharSequence hideAfter(CharSequence phone)
phone
- 手机号码public static CharSequence subBefore(CharSequence phone)
phone
- 手机号码public static CharSequence subBetween(CharSequence phone)
phone
- 手机号码public static CharSequence subAfter(CharSequence phone)
phone
- 手机号码public static CharSequence subTelBefore(CharSequence value)
value
- 完整的固话号码public static CharSequence subTelAfter(CharSequence value)
value
- 完整的固话号码Copyright © 2024. All rights reserved.