OxL Reference

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✓ checked in CI
fn main() io {
  print("{"a,b,,c".split(",")}")
}
Output
["a", "b", "", "c"]

Splits at every occurrence of sep.

Example:

oxl✓ checked in CI
fn main() io {
  print("{"a,b,,c".split(",")}")
}
Output
["a", "b", "", "c"]
pub(api) fn split(sep: str) -> List<str>

Complexity. O(n).

Since. 1.0.0-beta

Parameters

NameType
sepstr

Returns

List<str>

Effects

none declared (pure unless the body says otherwise)

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

See also