Function eqlIgnoreCase [src]

Compares strings a and b case-insensitively and returns whether they are equal.

Prototype

pub fn eqlIgnoreCase(a: []const u8, b: []const u8) bool

Parameters

a: []const u8b: []const u8

Example

test eqlIgnoreCase { try std.testing.expect(eqlIgnoreCase("HEl💩Lo!", "hel💩lo!")); try std.testing.expect(!eqlIgnoreCase("hElLo!", "hello! ")); try std.testing.expect(!eqlIgnoreCase("hElLo!", "helro!")); }

Source

pub fn eqlIgnoreCase(a: []const u8, b: []const u8) bool { if (a.len != b.len) return false; for (a, 0..) |a_c, i| { if (toLower(a_c) != toLower(b[i])) return false; } return true; }