MCPcopy
hub / github.com/ocsjs/ocsjs / hide

Method hide

packages/core/src/utils/string.ts:76–79  ·  view source on GitHub ↗

隐藏字符串

(str: string, start: number, end: number, replacer: string = '*')

Source from the content-addressed store, hash-verified

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 = '*') {

Callers 1

callbackFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected