1.mssql中
SELECT INSERT(mobile, 4, 4, \'****\')AS Mobile from Users ;
2.正则
s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
3.js
var tel = 18810399133;
tel = "" + tel;
var tel1 = tel.substr(0,3) + "****" + tel.substr(7)
console.log(tel1);
相关文章: