java简单代码、校验手机号纯数字8-13位,同时手机号码中间4位打星号。
public class testIsPhone {
public static void main(String[] args) {
boolean a=isMobileNO("12345678901");
boolean b=isMobileNO("1234567890");
boolean c=isMobileNO("123456789012");
System.out.println("a="+ a);
System.out.println("b="+ b);
System.out.println("c="+ c);
boolean av6=isMobileNOV2("123456");
boolean av7=isMobileNOV2("1234567");
boolean av2=isMobileNOV2("01234567");
boolean bv2=isMobileNOV2("012345678");
boolean cv2=isMobileNOV2("0123456789");
boolean dv2=isMobileNOV2("12345678901");
boolean ev2=isMobileNOV2("123456789012");
boolean fv2=isMobileNOV2("1234567890123");
boolean gv2=isMobileNOV2("12345678901234");
System.out.println(

本文介绍了使用Java进行手机号码的校验,确保号码由8到13位纯数字组成,并且在展示时能将手机号码的中间4位替换为星号,保护用户隐私。
最低0.47元/天 解锁文章
2104

被折叠的 条评论
为什么被折叠?



