OpenBI Docs Buy

Text.AfterDelimiter

What comes after a delimiter in a text: after its first occurrence, or after the one you choose.

Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Text.AfterDelimiter(text as nullable text, delimiter as text, optional index as any) as any
ParameterTypeDescription
textnullable textThe text to work on; null gives null.
delimitertextThe text to look for.
indexany
optional
Which occurrence of the delimiter to use, counted from 0; or a list {index, RelativePosition.FromEnd} to count from the end of the text. Left out, the first one.

Returns

any. The rest of the text after the delimiter; an empty text when the delimiter isn't there.

Remarks

  • The search is exact: case counts.
  • When the delimiter is missing the answer is empty, where Text.BeforeDelimiter gives the whole text.

Examples

After the first dash

Text.AfterDelimiter("NO-0150-Oslo", "-")
"0150-Oslo"

After the second dash

The index counts from 0: 1 is the second dash.

Text.AfterDelimiter("NO-0150-Oslo", "-", 1)
"Oslo"

After the last dash

Text.AfterDelimiter("NO-0150-Oslo", "-", {0, RelativePosition.FromEnd})
"Oslo"

Text.BeforeDelimiter, Text.BetweenDelimiters, Text.Split, Text.PositionOf.

Last updated · OpenBI Studio 0.3.79