opEqualsCaseInsensitive

Compares two strings to see if they match if case is ignored.

Only works with ASCII.

pure @safe nothrow @nogc
opEqualsCaseInsensitive
(
const string lhs
,
const string rhs
,)

Parameters

lhs string

Left-hand side of the comparison.

rhs string

Right-hand side of the comparison.

mapping IRCServer.CaseMapping

The server case mapping to apply.

Return Value

Type: auto

true if lhs and rhs are deemed to be case-insensitively equal; false if not.

Examples

immutable c = IRCServer.CaseMapping.rfc1459;

assert("joe".opEqualsCaseInsensitive("JOE", c));
assert("joe".opEqualsCaseInsensitive("joe", c));
assert(!"joe".opEqualsCaseInsensitive("Bengt", c));
assert(!"joe".opEqualsCaseInsensitive("", c));
assert("^o^".opEqualsCaseInsensitive("~o~", c));
assert("[derp]FACE".opEqualsCaseInsensitive("{DERP]face", c));
assert("C:\\".opEqualsCaseInsensitive("c:|", c));

Meta