1.切割
phone = res.phone.substr(0, 3) + '****' + res.phone.substr(7)
2.正则
var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
return item.replace(reg, "$1****$2")
phone = res.phone.substr(0, 3) + '****' + res.phone.substr(7)
var reg = getRegExp('^(\d{3})\d{4}(\d{4})$')
return item.replace(reg, "$1****$2")
本文标题:手机号码隐藏中间4位
本文链接:https://www.haomeiwen.com/subject/grtuxrtx.html
网友评论