手机号码中间四位加星号

时间:2020-06-11 16:11:38   收藏:0   阅读:37
function tel(tel) {
    const telNum = tel.toString();  
    const reg = /^(\d{3})\d{4}(\d{4})$/;
    return telNum.replace(reg, ‘$1****$2‘)
}
tel(13212341234)

 

原文:https://www.cnblogs.com/boystao/p/13093655.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!