Basic module

advance

procedure · 2 overloadsSource

Removes the first amount bytes (one by default) from the string s points to. amount must not be negative or more than the length of the string, or an assert fails.

advance :: (s: *string, amount: s64 = 1)

Parameters

s: *string
amount: s64
ExampleOpen in playground ↗
text := "hello";
advance(*text, 2);
assert(text == "llo");
advance :: (s: string, amount: s64 = 1) -> string

The string s without its first amount bytes (one by default), pointing into the same memory. amount must not be negative or more than the length of s, or an assert fails.

Parameters

s: string
amount: s64

Returns

string
ExampleOpen in playground ↗
assert(advance("hello", 2) == "llo");

See also