隐藏字符串
(str: string, start: number, end: number, replacer: string = '*')
| 74 | |
| 75 | /** 隐藏字符串 */ |
| 76 | static hide(str: string, start: number, end: number, replacer: string = '*') { |
| 77 | // 从 start 到 end 中间的字符串全部替换成 replacer |
| 78 | return str.substring(0, start) + str.substring(start, end).replace(/./g, replacer) + str.substring(end); |
| 79 | } |
| 80 | |
| 81 | /** 隐藏字符串 */ |
| 82 | hide(start: number, end: number, replacer: string = '*') { |