String module

compare_nocase

procedure · 1 overloadSource

Like compare, but ASCII letters match in either case. Bytes outside A-Z and a-z compare as they are, so this does not fold other scripts.

compare_nocase :: (a: string, b: string) -> int

Parameters

a: string
b: string

Returns

int
ExampleOpen in playground ↗
assert(compare_nocase("Hello", "hELLO") == 0);
assert(compare_nocase("a", "B") == -1);

See also