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:
fn main() io {
print("{"a,b,,c".split(",")}")
}Output
["a", "b", "", "c"]
Splits at every occurrence of sep.
Example:
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
| Name | Type |
|---|---|
sep | str |
Returns
List<str>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:478