语法
- string replace(inputString, oldString, newString)
参数
- inputString - 字符串
- oldString - 字符串
- newString -(浮点型、布尔、字符串)
返回
inputString 的副本,其中 oldString 替换为 newString。
描述
replace 函数用于将 oldString 在 inputString 中的所有出现替换为 newString。
相关内容
示例
replace("rule your city with cityengine","your city","designs")
# result = "rule designs with cityengine"
replace("myTexture.#.jpg","#","1")
# result = "myTexture.1.jpg"
# this example is e.g. useful for index-based texturing