String module

find_index_of_any_from_left

procedure · 1 overloadSource

The index of the first byte of s at or after start_index that is in bytes, or -1 when there is none.

find_index_of_any_from_left :: (
    s: string,
    bytes: string,
    start_index := 0
) -> s64

A negative start_index starts at the beginning. An empty bytes never matches.

Parameters

s: string
bytes: string
start_index := 0

Returns

s64
ExampleOpen in playground ↗
assert(find_index_of_any_from_left("key=value;", "=;") == 3);
assert(find_index_of_any_from_left("key=value;", "=;", 4) == 9);

See also