Splitter.SplitTextByPositions

Syntax

 
Splitter.SplitTextByPositions(positions as list, optional startAtEnd as nullable logical) as function

About

Returns a function that splits text into a list of text at each specified position.

Example 1

Split the input at the specified positions, starting from the beginning of the input.

Usage

Splitter.SplitTextByPositions({0, 3, 4})("ABC|12345")

Output

{"ABC", "|", "12345"}

Example 2

Split the input at the specified positions, starting from the end of the input.

Usage

let
    startAtEnd = true
in
    Splitter.SplitTextByPositions({0, 5}, startAtEnd)("Redmond98052")

Output

{"Redmond", "98052"}