How do I compare strings ignoring the case?
1 answer
Search D online help with an accuracy of 30 seconds at:
http://dlang.org/phobos/std_string.html
I found String.icmp
:
alias icmp = std.uni.icmp (S1, S2) (S1 str1, S2 str2) if (isForwardRange! S1 && is (Unqual! (ElementType! S1) == dchar) && isForwardRange! S2 && is (Unqual! ( ElementType! S2) == dchar));
Compares two ranges of characters lexicographically. The comparison is case insensitive. Use std.algorithm.cmp for case comparison. See the std.uni.icmp file for details.
< 0 s1 < s2
= 0 s1 == s2
> 0 s1 > s2
+7
source to share