Skip to main content
Version: Next

string

Strings of characters

let length: (_: string) => nat

The call length(s) is the number of characters in the string s. Note: String.length is another name for String.size.

let size: (_: string) => nat

The call size(s) is the number of characters in the string s.

let concat: (_: string) => (_: string) => string

The call concat(left, right) is the concatenation of the string left and the string right, in that order.

let concats: (_: list<string>) => string

The call concats(list) is the concatenation of the strings in the list list, from left to right.

let sub: (_: nat) => (_: nat) => (_: string) => string

The call sub(index, len, str) is the substring of string str starting at index index (0 denoting the first character) and of length len. If the index or length are invalid, an exception interrupts the execution.

let slice: (_: nat) => (_: nat) => (_: string) => string

The call slice(index, len, str) is the substring of string str starting at index index (0 denoting the first character) and of length len. If the index or length are invalid, an exception interrupts the execution.