Basic module

to_integer

procedureSource

Reads a decimal int from the start of s, as string_to_int does.

to_integer :: (s: string) -> (result: int, success: bool, remainder: string)

Parameters

s: string

Returns

result: int
success: bool
remainder: string
Example↗
value, ok, rest := to_integer("42px");
assert(ok && value == 42 && rest == "px");

See also