Skip to main content
Version: Next

string

Strings of characters

let length: (_: string) => nat

The call String.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 String.size(s) is the number of characters in the string s.

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

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

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

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

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

The call String.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 String.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.