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
| Parameter | Type | Description |
|---|---|---|
text | nullable text | The text to work on; null gives null. |
delimiter | text | The text to look for. |
index | any 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.BeforeDelimitergives 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"
Related functions
Text.BeforeDelimiter, Text.BetweenDelimiters, Text.Split, Text.PositionOf.