共用方式為


Text.Range

語法

Text.Range(
    text as nullable text,
    offset as number,
    optional count as nullable number
) as nullable text

關於

返回在偏移量 text 處從文字 offset 找到的子字串。 可以包含選擇性參數 count 來指定要傳回的字元數。 若沒有足夠的字元,則拋出錯誤。

範例 1

從索引 6 開始尋找文字 "Hello World" 中的子字串。

使用方式

Text.Range("Hello World", 6)

輸出

"World"

範例 2

從索引 6 開始橫跨 5 個字元來尋找文字 "Hello World Hello" 中的子字串。

使用方式

Text.Range("Hello World Hello", 6, 5)

輸出

"World"