Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Syntax
Splitter.SplitTextByRanges(ranges as list, optional startAtEnd as nullable logical) as function
About
Returns a function that splits text into a list of text according to the specified offsets and lengths. A null length indicates that all remaining input should be included.
Example 1
Split the input by the specified position and length pairs, starting from the beginning of the input. Note that the ranges in this example overlap.
Usage
Splitter.SplitTextByRanges({{0, 4}, {2, 10}})("codelimiter")
Output
{"code", "delimiter"}
Example 2
Split the input by the specified position and length pairs, starting from the end of the input.
Usage
let
startAtEnd = true
in
Splitter.SplitTextByRanges({{0, 5}, {6, 2}}, startAtEnd)("RedmondWA?98052")
Output
{"WA", "98052"}
Example 3
Split the input into a fixed-length postal code followed by a variable-length city name.
Usage
Splitter.SplitTextByRanges({{0, 5}, {5, null}})("98052Redmond")
Output
{"98052", "Redmond"}