Splitter.SplitTextByPositions

This function returns a new function that divides a string into a list of strings based on specified positions.

Syntax

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

About

This function returns a new function that divides a string into a list of strings based on specified positions.

Explanation

Example 1 Divide the input into parts based on defined positions, beginning from the start of the input. Usage: In Power Query M: Splitter.SplitTextByPositions({0, 3, 4})("ABC|12345") Output: {"ABC", "|", "12345"} Example 2 Divide the input into parts based on specified positions, starting from the end of the input. Usage: In Power Query M: let startAtEnd = true in Splitter.SplitTextByPositions({0, 5}, startAtEnd)("Redmond98052") Output: {"Redmond", "98052"}