replaceAll

以基本字串中的取代字串取代所有符合目標字串的發生次數。

從字串開始到結束的取代,例如,在字串"aaa"中以"b"取代"aa"將產生"ba",而非"ab"。

類別

String

函式語法

replaceAll(<parameters>)

參數

參數 類型
base 字串
目標 字串
替換 字串

簽名和傳回的類型

replaceAll(<baseString>,<sourceString>,<replacementString>)

傳回字串。

範例

replaceAll("Hello World", "l", "x")

傳回"Hexxo Worxd"。

本頁內容

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now