js 替换部分内容为星号
时间:2016-06-22 12:54:58
收藏:0
阅读:2315
functionformatPh(phoneone) {returnphone.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"); }
姓名显示最后一个字,其余用星号代替
‘实打实的‘.(/.(?=.)/g,replace‘*‘);
returnnewArray(str.length).join(‘*‘)str.+substr(-1);
评论(0)