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, "**"); }}
原文地址:https://www.cnblogs.com/wxyz9527/p/11350388.html
时间: 2024-11-02 18:08:14