substr

上次更新: 2023-08-18
  • 主題:
  • Journeys
    檢視有關此主題的更多資訊
  • 建立對象:
  • Experienced
    Developer

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

類別

字串

函式語法

substr(<parameters>)

參數

參數 type
字串 字串
beginindex 整數
endIndex 整數

簽章與傳回的型別

substr(<string>,<beginIndex>)

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

傳回字串。

範例

substr("Hello World",6)

傳回「World」。

substr("Hello World", 0, 5)

傳回「Hello」。

此頁面上的