Comment on page
Text.BetweenDelimiters
Text.BetweenDelimiters
function (optionaltext
as nullable any,startDelimiter
as text,endDelimiter
as text, optionalstartIndex
as nullable any, optionalendIndex
as nullable any) as nullable any
Returns the portion of
text
between the specified startDelimiter
and endDelimiter
. An optional numeric startIndex
indicates which occurrence of the startDelimiter
should be considered. An optional list startIndex
indicates which occurrence of the startDelimiter
should be considered, as well as whether indexing should be done from the start or end of the input. The endIndex
is similar, except that indexing is done relative to the startIndex
.Text.Transformations
Get the portion of "111 (222) 333 (444)" between the (first) open parenthesis and the (first) closed parenthesis that follows it.
Text.BetweenDelimiters("111 (222) 333 (444)", "(", ")")
"222"
Get the portion of "111 (222) 333 (444)" between the second open parenthesis and the first closed parenthesis that follows it.
Text.BetweenDelimiters("111 (222) 333 (444)", "(", ")", 1, 0)
"444"
Get the portion of "111 (222) 333 (444)" between the second open parenthesis from the end and the second closed parenthesis that follows it.
Text.BetweenDelimiters("111 (222) 333 (444)", "(", ")", {1, RelativePosition.FromEnd}, {1, RelativePosition.FromStart})
"222) 333 (444"
Last modified 5yr ago