split
splits a string using a separator into smaller substrings. It returns
a vector of these substrings.
(split "" "")
➜[]
(split "," "")
➜[""]
(split "," "a,b,1")
➜["a", "b", "1"]
(split "" "hello")
➜["h", "e", "l", "l", "o"]
separator
is an arbitrary expression that evaluates to a string.value
is an arbitrary expression that evaluates to a string.
split
splits the value
and returns a vector with the substrings.
split
executes separator and vector in their own contexts, so nothing is
shared.