共用方式為


Text.RemoveRange

語法

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

關於

傳回文字值 text 的複本,並移除位置 offset 的所有字元。 選擇性參數 count 可以用來指定要移除的字元數。 count 的預設值為 1。 位置值從 0 開始。

範例 1

從位置 2 開始,移除文字值 "ABEFC" 中的 1 個字元。

使用方式

Text.RemoveRange("ABEFC", 2)

輸出

"ABFC"

範例 2

從位置 2 開始,移除文字值 "ABEFC" 中的兩個字元。

使用方式

Text.RemoveRange("ABEFC", 2, 2)

輸出

"ABC"