Function: formatPhone

formatPhone(phone, symbol?): string

手机号码中间部分替换成指定符号

Parameters

Name Type Default value Description
phone string undefined 手机号码字符串
symbol string '****' 替换符号,默认为'****'

Returns

string

格式化后的手机号码字符串

Example

formatPhone('15858264903');
// => '158****4903'

formatPhone('15858264903', '####');
// => '158####4903'
ON THIS PAGE