Text functions, for building and parsing strings
Text functions, for building and parsing strings
(append! sb data)
Appends data to a string builders. sb - the string builder. data - the data to append in string form. return: the string builder (may be ignored since it mutates)
Appends data to a string builders. sb - the string builder. data - the data to append in string form. return: the string builder (may be ignored since it mutates)
(buffer-empty? b)
Returns true when the buffer has no data
Returns true when the buffer has no data
(char-at s n)
Returns the character at a given position in the string, or :eof at the end of the string.
Returns the character at a given position in the string, or :eof at the end of the string.
(char-code c)
(high-surrogate? c)
Tests if a character is both a high surrogate (0xD800 <= c <= 0xDBFF) and also in range (0xD800 <= c <= 0xDB7F) which matches the character range 0x10000 to 0xEFFFF
Tests if a character is both a high surrogate (0xD800 <= c <= 0xDBFF) and also in range (0xD800 <= c <= 0xDB7F) which matches the character range 0x10000 to 0xEFFFF
(last-char sb)
Returns the last char appended to a string builder.
Equivalent to (last (str sb))
but uses direct calls.
sb - the mutable string builder.
return: the final char.
Returns the last char appended to a string builder. Equivalent to `(last (str sb))` but uses direct calls. sb - the mutable string builder. return: the final char.
(last-char-str s)
Returns the last char of a str.
Equivalent to (last s)
but in constant time.
s - The string.
return: the final char.
Returns the last char of a str. Equivalent to `(last s)` but in constant time. s - The string. return: the final char.
(low-surrogate? c)
Tests if a character is a low surrogate (0xDC00 <= c <= 0xDFFF) which matches the character range 0x10000 to 0xEFFFF
Tests if a character is a low surrogate (0xDC00 <= c <= 0xDFFF) which matches the character range 0x10000 to 0xEFFFF
(lower-case-char c)
Converts a single character to lower-case. Characters in ClojureScript are single-element strings.
Converts a single character to lower-case. Characters in ClojureScript are single-element strings.
(parse-hex s)
Parses a hexadecimal string into a long
Parses a hexadecimal string into a long
(ssubs s start end)
A safe substring function. The same as a 3 argument subs
but will not run out of range.
A safe substring function. The same as a 3 argument `subs` but will not run out of range.
(string-builder)
(string-builder init)
Creates a mutable string builder. init - optional initial string. return: an object that can be appended to.
Creates a mutable string builder. init - optional initial string. return: an object that can be appended to.
(surrogates u)
Converts a long value to a high/log surrogate pair.
Converts a long value to a high/log surrogate pair.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close