OxL Справочник OxL
РусскийEnglish

method str.lines

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

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"first\nsecond\r\nthird".lines()}")
}
Вывод
["first", "second", "third"]

Splits into lines.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"one\ntwo".lines()}")
}
Вывод
["one", "two"]
pub(api) fn lines() -> List<str>

Сложность. O(n).

С версии. 1.0.0-beta

Возвращает

List<str>

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/text.oxl:528

См. также