Standard Library
string
Inspect, transform, and reshape text.
Import:
import "string";upper / lower / capitalize
Change case.
"hello" | upper | print; // HELLO
"HELLO" | lower | print; // hello
"hello" | capitalize | print; // Hellolength
Number of characters in a string.
"may" | length | print; // 3char
Return the character at an index. Indexing starts at zero.
char("hello", 1) | print; // esubstring
Slice out a portion of a string.
substring("hello world", 6, 11) | print; // worldreplace
Swap every occurrence of a pattern.
replace("hello world", "world", "may") | print;alpha / numeric / alphanumeric
Predicates that report whether a string contains only the given character class.
alpha("hello") | print; // 1
numeric("hello123") | print; // 0
alphanumeric("abc12") | print; // 1toString
Render a number as a string. Useful when concatenating with text.
int n = 42;
print("n is " + toString(n));