“Other” 方法

$t.hideMiddleNumber(target, replaceChar = '*')

隐藏数字账号的中间位,只显示前后 4 位数字。中间位用 4 个 replaceChar 字符代替。

参数

target (Number | String): 账号。

replaceChar (String): 替换的字符,默认为 '*' 空字符串。

返回

(String): 返回替换后的账号信息。

示例


$t.hideMiddleNumber(15688889999, '#')            // 1568####9999

$t.hideMiddleNumber('530521199308287319')   // 5305****7319

results matching ""

    No results matching ""