'\" t .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" .TH Text.lines 3 2025-04-30 "Tomo man-pages" .SH NAME Text.lines \- get list of lines .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf .BI Text.lines\ :\ func(text:\ Text\ ->\ [Text]) .fi .SH DESCRIPTION Splits the text into a list of lines of text, preserving blank lines, ignoring trailing newlines, and handling `\r\n` the same as `\n`. .SH ARGUMENTS .TS allbox; lb lb lbx lb l l l l. Name Type Description Default text Text The text to be split into lines. - .TE .SH RETURN A list of substrings resulting from the split. .SH EXAMPLES .EX >> "one\[rs]ntwo\[rs]nthree".lines() = ["one", "two", "three"] >> "one\[rs]ntwo\[rs]nthree\[rs]n".lines() = ["one", "two", "three"] >> "one\[rs]ntwo\[rs]nthree\[rs]n\[rs]n".lines() = ["one", "two", "three", ""] >> "one\[rs]r\[rs]ntwo\[rs]r\[rs]nthree\[rs]r\[rs]n".lines() = ["one", "two", "three"] >> "".lines() = [] .EE