Skip to main content
Version: 1.1.0


let length: (s: string) => nat

Get the size of a string.

Michelson only supports ASCII strings so for now you can assume that each character takes one byte of storage.

let size_op = (s: string): nat => String.length(s);
let sub: (offset: nat, length: nat, s: string) => string

Extract a substring from a string based on the given offset and length. For example the string "abcd" given to the function below would return "bc".

let slice_op = (s: string): string => String.sub(1n, 2n, s);
let concat: (a: string, b: string) => string

Concatenate two strings and return the result.

let concat_syntax = (s: string): string => String.concat(s, "test_literal");


let concat_syntax_alt = (s: string): string => s + "test_literal";
let concats: (ss: list<string>) => string

Concatenate together a list of string and return the result.