OxL Reference

method str.lines

The lines of the text, without the line terminators (\n or \r\n).

Example:

oxl✓ checked in CI
fn main() io {
  print("{"first\nsecond\r\nthird".lines()}")
}
Output
["first", "second", "third"]

Splits into lines.

Example:

oxl✓ checked in CI
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

See also