# replace-替换
调用replace函数替换指定文本。
最小支持版本:5.0.0
# 接口说明
已构建Cube.Lang.String临时对象。
# 语法
<String object>.replace(<old>, <new>, <caseSensitive>)
1
<String object>.替换(<old>, <new>, <caseSensitive>)
1
# 函数类型
实例函数
# 请求参数
参数名称 | 类型 | 是否必选 | 默认值 | 示例值 | 描述 |
---|---|---|---|---|---|
old | Cube.Lang.String | 是 | 无 | "abc" | 被替换的旧内容。 |
new | Cube.Lang.String | 是 | 无 | "test" | 替换后的新内容。 |
caseSensitive | Cube.Lang.Boolean | 是 | true | true | 是否区分大小写。取值: true:区分 false:不区分 |
# 返回参数
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Result | Cube.Lang.String | "test" | 替换指定文本。 |
# 请求示例
"abc".replace("abc", "test", true)
1
最近更新时间: {
"value": "2023-09-12",
"effect": true
}