(39 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Text.lines 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Text.lines \- get list of lines8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Text.lines\ :\ func(text:\ Text\ ->\ [Text])13 .fi14 .SH DESCRIPTION15 Splits the text into a list of lines of text, preserving blank lines, ignoring trailing newlines, and handling `\r\n` the same as `\n`.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 text Text The text to be split into lines.26 .TE27 .SH RETURN28 A list of substrings resulting from the split.30 .SH EXAMPLES31 .EX32 assert "one\[rs]ntwo\[rs]nthree".lines() == ["one", "two", "three"]33 assert "one\[rs]ntwo\[rs]nthree\[rs]n".lines() == ["one", "two", "three"]34 assert "one\[rs]ntwo\[rs]nthree\[rs]n\[rs]n".lines() == ["one", "two", "three", ""]35 assert "one\[rs]r\[rs]ntwo\[rs]r\[rs]nthree\[rs]r\[rs]n".lines() == ["one", "two", "three"]36 assert "".lines() == []37 .EE38 .SH SEE ALSO39 .BR Tomo-Text (3)