Name

string:split

Usage

builtin-function

Syntax

(string:split str)
(string:split str count)
(string:split str separators)
(string:split str separators count)

Description

These forms are Kiezellisp extension methods. The first and second forms split on white space and always remove empty substrings. In the third and fourth forms separators is a string or another sequence (IEnumerable other than string). In case of a string, the function splits on the individual characters of the string.

user 1 > (.split "aap noot mies" 2)
it: ["aap" "noot mies"]
user 2 > :d
#s( :members #s( :is-fixed-size true
                 :is-read-only false
                 :is-synchronized false
                 :length 2
                 :long-length 2
                 :rank 1
                 :sync-root ["aap" "noot mies"] )
    :type "System.String[]"
    :value ["aap" "noot mies"] )

user 2 > (.split "hello, world" "lw")
it: ["he" "" "o, " "or" "d"]
user 3 > :d
#s( :members #s( :is-fixed-size true
                 :is-read-only false
                 :is-synchronized false
                 :length 5
                 :long-length 5
                 :rank 1
                 :sync-root ["he" "" "o, " "or" "d"] )
    :type "System.String[]"
    :value ["he" "" "o, " "or" "d"] )