OxL Reference

method Regex.split

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

Example:

oxl✓ checked in CI
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

NameType
sstr

Returns

List<str>

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:1395

See also