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

method Regex.split

Pieces between the matches (re"\s*,\s*" splits a comma list); empty matches do not split.

Example:

oxl✓ проверяется в CI
fn main() io {
  let re = Regex.compile("\\s*,\\s*")!
  print("{re.split("a , b,c")}")
}
Вывод
["a", "b", "c"]
pub(api) fn split(s: str) -> List<str>

Сложность. O(n) in the length of the text.

С версии. 1.0.0-beta

Параметры

ИмяТип
sstr

Возвращает

List<str>

Эффекты

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

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

См. также