标签:return tar ice ret slice str star 适配 amp
StarPhone(phone) {
var str = String(phone);
var len = str.length;
if (len >= 7) {
var reg = str.slice(-7, -3);
return str.replace(reg, "****");
} else if (len < 7 && len >= 6) {
//1234567
var reg1 = str.slice(-4, -2);
return str.replace(reg1, "**");
}
}
标签:return tar ice ret slice str star 适配 amp
原文地址:https://www.cnblogs.com/wxyz9527/p/11350388.html