# Replace - 指令碼與圖表函數

將輸入字串內所有出現的指定子字串取代為另一個子字串之後，Replace() 會傳回該字串。此函數不遞迴並會從左至右運作。

語法：

Replace(text, from\_str, to\_str)

傳回的資料類型： 字串

引數：

Replace 引數

| 引數 | 描述 |
| --- | --- |
| text | 原始字串。 |
| from\_str | 輸入字串 text 內可能出現一次或多次的字串。 |
| to\_str | 要取代字串 text 內所有出現的 from\_str 的字串。 |

範例與結果：

範例與結果

| 範例 | 結果 |
| --- | --- |
| `Replace('abccde','cc','xyz')` | 傳回 'abxyzde' |