Dynamic.String

char-at

command

Dynamic

gets the nth character of a string.

Example Usage:

(String.char-at "hi" 1) ; => \i

concat

command

Dynamic

concatenates a list of strings together.

Example Usage:

(String.concat ["hi " "there"]) ; => "hi there"

empty?

dynamic

Dynamic

                        (empty? s)
                    

dynamic

Dynamic

                        (head s)
                    

takes the head of the string s as a one-character string.

index-of

command

Dynamic

gets the index of a character in a string (or returns -1 if the character is not found).

Example Usage:

(index-of "hi" \i) ; => 1

length

command

Dynamic

gets the length of a string.

Example Usage:

(String.length "hi") ; => 2

prefix

dynamic

Dynamic

                        (prefix s to)
                    

takes the prefix of the string s up to the index to.

slice

command

Dynamic

creates a substring from a beginning index to an end index.

Example Usage:

(String.slice "hello" 1 3) ; => "ell"

split-on

command

Dynamic

split a string at separator.

Example Usage:

(String.split-on "-" "hi-there") ; => ["hi " "there"]

suffix

dynamic

Dynamic

                        (suffix s from)
                    

takes the suffix of the string s from the index from.

tail

dynamic

Dynamic

                        (tail s)
                    

takes the tail of the string s.

to-array

dynamic

Dynamic

                        (to-array s)
                    

Converts a string to an array of strings of each of its characters.

to-list

dynamic

Dynamic

                        (to-list s)