method str.lines
The lines of the text, without the line terminators (\n or \r\n).
Example:
fn main() io {
print("{"first\nsecond\r\nthird".lines()}")
}Output
["first", "second", "third"]
Splits into lines.
Example:
fn main() io {
print("{"one\ntwo".lines()}")
}Output
["one", "two"]
pub(api) fn lines() -> List<str>Complexity. O(n).
Since. 1.0.0-beta
Returns
List<str>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:528