core
String
/=
defn
(λ [&String, &String] Bool)
(/= a b)
<
external
(λ [&String, &String] Bool)
=
external
(λ [&String, &String] Bool)
>
external
(λ [&String, &String] Bool)
allocate
external
(λ [Int, Char] String)
alpha?
defn
(λ [&String] Bool)
(alpha? s)
checks whether a string contains only alphabetical characters (a-Z).
alphanum?
defn
(λ [&String] Bool)
(alphanum? s)
checks whether a string is alphanumerical.
append
external
(λ [&String, &String] String)
char-at
external
(λ [&String, Int] Char)
chars
external
(λ [&String] (Array Char))
chomp
defn
(λ [&String] String)
(chomp s)
trims a newline from the end of a string.
collapse-whitespace
defn
(λ [&String] String)
(collapse-whitespace s)
collapses groups of whitespace into single spaces.
concat
defn
(λ [(Ref (Array String))] String)
(concat strings)
Returns a new string which is the concatenation of the provided strings
.
contains?
defn
(λ [&String, Char] Bool)
(contains? s c)
Checks whether the string s
contains the character c
.
count-char
defn
(λ [&String, Char] Int)
(count-char s c)
Returns the number of occurrences of c
in the string s
.
cstr
external
(λ [&String] (Ptr Char))
empty?
defn
(λ [&String] Bool)
(empty? s)
Check if the string is the empty string.
ends-with?
defn
(λ [&String, &String] Bool)
(ends-with? s sub)
Check if the string s
ends with the string sub
.
external
(λ [&String, &String] String)
from-chars
external
(λ [(Ref (Array Char))] String)
hash
defn
(λ [&String] Int)
(hash k)
head
defn
(λ [&String] Char)
(head s)
Returns the character at start of string.
hex?
defn
(λ [&String] Bool)
(hex? s)
checks whether a string is hexadecimal.
in?
defn
(λ [&String, &String] Bool)
(in? s sub)
checks whether a string contains another string.
index-of
external
(λ [&String, Char] Int)
join
defn
(λ [String, (Ref (Array String))] String)
(join sep strings)
Returns a new string which is the concatenation of the provided strings
separated by string sep
.
join-with-char
defn
(λ [Char, (Ref (Array String))] String)
(join-with-char sep strings)
Returns a new string which is the concatenation of the provided strings
separated by char sep
.
length
external
(λ [&String] Int)
lines
defn
(λ [&String] (Array String))
(lines s)
splits a string into lines.
lower?
defn
(λ [&String] Bool)
(lower? s)
checks whether a string is all lowercase.
num?
defn
(λ [&String] Bool)
(num? s)
checks whether a string is numerical.
pad-left
defn
(λ [Int, Char, &String] String)
(pad-left len pad s)
Pads the left of a string with len bytes using the padding pad.
pad-right
defn
(λ [Int, Char, &String] String)
(pad-right len pad s)
Pads the right of a string with len bytes using the padding pad.
prefix-string
defn
(λ [&String, Int] String)
(prefix-string s a)
Return the first a
characters of the string s
.
prn
external
(λ [&String] String)
repeat
defn
(λ [Int, &String] String)
(repeat n inpt)
Returns a new string which is inpt
repeated n
times.
reverse
defn
(λ [&String] String)
(reverse s)
Produce a new string which is s
reversed.
split-by
defn
(λ [&String, (Ref (Array Char))] (Array String))
(split-by s separators)
splits a string by separators.
starts-with?
defn
(λ [&String, &String] Bool)
(starts-with? s sub)
Check if the string s
begins with the string sub
.
str
external
(λ [&String] String)
substring
defn
(λ [&String, Int, Int] String)
(substring s a b)
suffix-string
defn
(λ [&String, Int] String)
(suffix-string s b)
Return the last b
characters of the string s
.
sum-length
defn
(λ [(Ref (Array String))] Int)
(sum-length strings)
Returns the sum of lengths from an array of Strings.
tail
external
(λ [&String] String)
trim
defn
(λ [&String] String)
(trim s)
trims whitespace from both sides of a string.
trim-left
defn
(λ [&String] String)
(trim-left s)
trims whitespace from the left of a string.
trim-right
defn
(λ [&String] String)
(trim-right s)
trims whitespace from the right of a string.
upper?
defn
(λ [&String] Bool)
(upper? s)
checks whether a string is all uppercase.
words
defn
(λ [&String] (Array String))
(words s)
splits a string into words.
zero
defn
(λ [] String)
(zero)
The empty string.