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()}")
}Вывод
["first", "second", "third"]
Splits into lines.
Example:
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