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

method str.split

The pieces of the text between occurrences of sep (an empty piece for neighbouring separators); the text itself when sep does not occur.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"a,b,,c".split(",")}")
}
Вывод
["a", "b", "", "c"]

Splits at every occurrence of sep.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"a,b,,c".split(",")}")
}
Вывод
["a", "b", "", "c"]
pub(api) fn split(sep: str) -> List<str>

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

С версии. 1.0.0-beta

Параметры

ИмяТип
sepstr

Возвращает

List<str>

Эффекты

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

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

См. также