replace 函数

此 2021.0 文档已存档,并且不再对其进行更新。 其中的内容和链接可能已过期。 请参阅最新文档

语法

  • string replace(inputString, oldString, newString)

参数

  1. inputString - 字符串
  2. oldString - 字符串
  3. newString -(浮点型、布尔、字符串

返回

inputString 的副本,其中 oldString 替换为 newString

描述

replace 函数用于将 oldStringinputString 中的所有出现替换为 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

在本主题中