OpenBI Docs Buy

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
ParameterTypeDescription
texttextThe text to cut.
separatortextThe 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"}

Text.SplitAny, Text.Combine, Splitter.SplitTextByDelimiter, Text.BeforeDelimiter.

Last updated · OpenBI Studio 0.3.79