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")}")
}Output
["a", "b", "c"]
pub(api) fn split(s: str) -> List<str>Complexity. O(n) in the length of the text.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
s | str |
Returns
List<str>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:1395