an input range of characters
an input range of characters
An int that is 0 if the strings match, <0 if r1 is lexicographically "less" than r2, >0 if r1 is lexicographically "greater" than r2
Warning: This function only handles 1:1 $(CODEPOINT) mapping and thus is not sufficient for certain alphabets like German, Greek and few others.
assert(sicmp("Август", "авгусТ") == 0); // Greek also works as long as there is no 1:M mapping in sight assert(sicmp("ΌΎ", "όύ") == 0); // things like the following won't get matched as equal // Greek small letter iota with dialytika and tonos assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); // while icmp has no problem with that assert(icmp("ΐ", "\u03B9\u0308\u0301") == 0); assert(icmp("ΌΎ", "όύ") == 0);
Does basic case-insensitive comparison of r1 and r2. This function uses simpler comparison rule thus achieving better performance than icmp. However keep in mind the warning below.