//数字3代表前后几位数字不被替换
String regex = "(\\w{3})(\\w+)(\\w{3})";
userName = userName.toString().replaceAll(regex, "$1****$3");
电话身份证掩码
最新推荐文章于 2024-06-29 03:16:28 发布
//数字3代表前后几位数字不被替换
String regex = "(\\w{3})(\\w+)(\\w{3})";
userName = userName.toString().replaceAll(regex, "$1****$3");