SHARE
TWEET

Untitled

a guest Aug 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * 格式化手机号脱敏,如 '188****8888'
  3.  *
  4.  * @param phone 手机号
  5.  * @returns 脱敏后的手机号字符串
  6.  */
  7. export function phoneNumberDesensitization(phone: number | string): string {
  8.   return phone.toString().replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top