Skip to main content

replace 替换文本内容

replace

类型: MethodDeclaration

定义位置: local.ts

描述

替换文本内容

参数 text: 原始文本内容

返回值:替换本地化文本后的内容

参数

参数名类型描述默认值
textstring--

返回值

类型: string

替换本地化文本后的内容

源代码

位置: 第 157 行

public replace(text: string): string {
return text.replace(this.refRegexp, (match, refId) => {
const ref = this.get(refId)
return ref !== undefined ? ref : match
})
}

文档生成时间:2025/7/7 12:07:06