split multimethod
Methods
- split(e:Eachable1, delim:Any) Source: stdlib.ngs:3588
Split e into arrays Returns
Arr of ArrExample
[1, "a", 2, 3, "a", 4].split("a") # [[1], [2, 3], [4]]
- split(s:Str, delim:Str, max_parts:Int=0) Source: stdlib.ngs:4836
Split string by substring Parameters
s String to split delim Delimiter to split by max_parts Maximum number of resulting parts, 0 - unlimited Returns
Arr of StrExample
":a:bc:d:".split(":") # ["", "a", "bc", "d", ""] "bucket_name/dir/file".split("/", 2) # ["bucket_name", "dir/file"] ":a:bc:d:".split("bc") # [":a:", ":d:"]
- split(s:Str, r:RegExp) Source: stdlib.ngs:7770
Split string by regexp Returns
Arr of StrExample
"x10ab20c30y".split(/[0-9]+/).join(" :: ") # "x :: ab :: c :: y"