JanetDocsPlaygroundI'm feeling luckyGitHub sign in

string/split



    cfunction

    (string/split delim str &opt start limit)

    Splits a string str with delimiter delim and returns an array of 
    substrings. The substrings will not contain the delimiter delim. If 
    delim is not found, the returned array will have one element. Will 
    start searching for delim at the index start (if provided), and 
    return up to a maximum of limit results (if provided).


3 examplesSign in to add an example
Loading...
(string/split "\n" @"works\nfor\nbuffers\ntoo")
# => @["works" "for" "buffers" "too"]
sogaiuPlayground
(defn slurp-lines [path]
  (string/split "\n" (slurp path)))
cellularmitosisPlayground
(string/split "," "bruce,scott,tiger,woods")
# => @["bruce" "scott" "tiger" "woods"]
sogaiuPlayground