Text.Split
A text cut into a list of pieces at every occurrence of a separator.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.Split(text as text, separator as text) as list
| Parameter | Type | Description |
|---|---|---|
text | text | The text to cut. |
separator | text | The text that separates the pieces; it can be longer than one character. |
Returns
list. The pieces, without the separators.
Remarks
- Two separators in a row give an empty piece between them.
- To cut at any of several characters, use
Text.SplitAny.
Examples
A list of shops
Text.Split("Oslo;Bergen;Trondheim", ";")
{"Oslo", "Bergen", "Trondheim"}
A separator of two characters
Text.Split("Oslo, Bergen", ", ")
{"Oslo", "Bergen"}
An empty field
Text.Split("Chair,,Desk", ",")
{"Chair", "", "Desk"}
Related functions
Text.SplitAny, Text.Combine, Splitter.SplitTextByDelimiter, Text.BeforeDelimiter.