Text.Range

Syntax

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

About

返回在偏移量offset处找到的文本text中的子字符串。 可以包含可选参数 count来指定要返回的字符数。 如果没有足够的字符,则引发错误。

示例 1

从索引 6 开始的文本“Hello World”中找到子字符串。

用法

Text.Range("Hello World", 6)

输出

"World"

示例 2

从文本“Hello World Hello”中查找子字符串,从索引 6 开始,跨越 5 个字符。

用法

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

输出

"World"