/**
* 手机号座机号中间四位转*
* @param phoneNumber
* @returns
*/
export const usePhoneNumber = (phoneNumber:any) =>{
if(phoneNumber){
let maskedPart = phoneNumber.substring(3, 7).replace(/\d/g, "*");
let lastPart = phoneNumber.substring(7);
return phoneNumber.substring(0, 3) + maskedPart + lastPart;
} else {
return
}
}
javascript、typescript手机号座机号中间四位转*,全局公用方法
最新推荐文章于 2024-08-19 15:59:25 发布