手机号码隐藏中间4位
2021-12-02 本文已影响0人
IssunRadiance
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")