String phone="13589648661"; //模拟手机号
System.out.println(phone.substring(0, 3)+"****"+phone.substring(7));//截取前三位跟后四位 中间加上四个*即可
Java 手机号屏蔽 替换中间字符为*
最新推荐文章于 2024-03-11 21:04:17 发布
String phone="13589648661"; //模拟手机号
System.out.println(phone.substring(0, 3)+"****"+phone.substring(7));//截取前三位跟后四位 中间加上四个*即可