上代码:
String mobile="18888888888";
String all = mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
System.out.println(all);
打印结果为:
135****8855
上代码:
String mobile="18888888888";
String all = mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
System.out.println(all);
打印结果为:
135****8855