split multimethod

Methods

split(e:Eachable1, delim:Any) Source: stdlib.ngs:2179
Split e into arrays

Returns

Arr of Arr

Example

[1, "a", 2, 3, "a", 4].split("a")  # [[1], [2, 3], [4]]
split(s:Str, delim:Str, max_parts:Int=null) Source: stdlib.ngs:3325
Split string by substring

Returns

Arr of Str

Example

":a:bc:d:".split(":")   # ["", "a", "bc", "d", ""]
":a:bc:d:".split("bc")  # [":a:", ":d:"]
split(s:Str, r:RegExp) Source: stdlib.ngs:5546
Split string by regexp

Returns

Arr of Str

Example

"x10ab20c30y".split(/[0-9]+/).join(" :: ")  # "x :: ab :: c :: y"