Iterates over sub-strings.
When split-at
is a string, each character within that string is a potential splitter
character. Note that this behaviour differs from Rust's str::split
method.
Multiple consecutive splitter characters are separated internally by ""
.
(let it (split "Running::jump" \:))
(prn (arr ..it)) ; prints ("Running" "" "jump")
This means that split
can't be used to identify words separated by whitespace.
(let ws-chars " \r\n\t")
(let it (split "a \n b" ws-chars))
(prn (arr ..it)) ; prints ("a" "" "" "b")