Skip to content
ZstrCompareIgnoreCase

ZstrCompareIgnoreCase

Description

Compare two strings lexicographically, ignoring ASCII case. Non-ASCII bytes are compared as-is (no Unicode case folding).

Success

Returns 0 if equal under ASCII-case folding, <0 if lowered s1 < lowered s2, >0 otherwise.

Failure

Aborts via LOG_FATAL when either string pointer is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    i32 ZstrCompareIgnoreCase(Zstr s1, Zstr s2) {
        if (!s1 || !s2) {
            LOG_FATAL("Invalid arguments");
        ValidateStr(s);
        ValidateStr(other);
        return ZstrCompareIgnoreCase(StrBegin(s), StrBegin(other));
    }
    i32 str_cmp_zstr_ignore_case(const Str *s, Zstr other) {
        ValidateStr(s);
        return ZstrCompareIgnoreCase(StrBegin(s), other);
    }
Last updated on