substr

傳回begin索引和end索引之間字串運算式的子字串。 如果未定義結束索引,則它位於開始索引和結束索引之間。

類別

String

函式語法

substr(<parameters>)

參數

參數 type
字串 字串
beginIndex 整數
endIndex 整數

簽名和傳回的類型

substr(<string>,<beginIndex>)

substr(<string>,<beginIndex>,<endIndex>)

傳回字串。

範例

substr("Hello World",6)

傳回"World"。

substr("Hello World", 0, 5)

返回"Hello"。

本頁內容

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