Lines.ToText
A list of lines joined into one text, each line followed by a line break.
Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Lines.ToText(lines as list, optional lineSeparator as nullable text) as text
| Parameter | Type | Description |
|---|---|---|
lines | list | The lines, as texts. |
lineSeparator | nullable text optional | What ends each line. Left out, a carriage return and line feed, as in Windows. |
Returns
text. The lines in one text, the last line ended too.
Remarks
- Unlike
Text.Combine, the separator also comes after the last line, as in a text file.
Examples
Windows line breaks
Lines.ToText({"Oslo", "Bergen", "Trondheim"})
"Oslo#(cr,lf)Bergen#(cr,lf)Trondheim#(cr,lf)"
Line feeds only
Lines.ToText({"Oslo", "Bergen"}, "#(lf)")
"Oslo#(lf)Bergen#(lf)"