v0.1A scripting language for the web
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;  // Hello

length

Number of characters in a string.

"may" | length | print; // 3

char

Return the character at an index. Indexing starts at zero.

char("hello", 1) | print; // e

substring

Slice out a portion of a string.

substring("hello world", 6, 11) | print; // world

replace

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; // 1

toString

Render a number as a string. Useful when concatenating with text.

int n = 42;
print("n is " + toString(n));