method Regex.split
Pieces between the matches (re"\s*,\s*" splits a comma list); empty matches do not split.
Example:
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
Параметры
| Имя | Тип |
|---|---|
s | str |
Возвращает
List<str>
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:1395