String CompareOrdinal Static Method
int CompareOrdinal(string str1, string str2)
int CompareOrdinal(string str1, int iStartIndex1, string str2, int iStartIndex2, int iCount)
The static Compare methods perform a lexical comparison: String Compare Static Method int Compare(string str1, string str2)
int Compare(string strl, string str2, bool blgnoreCase)
int Compare(string strl, string str2, bool blgnoreCase, Culturelnfo ei) int Compare(string strl, int iStartlndexl, string str2, int iStartIndex2, int iCount)
int Compare(string strl, int iStartlndexl, string str2, int iStartIndex2, int iCount, bool blgnoreCase) int Compare(string strl, int iStartlndexl, string str2, int iStartIndex2, int iCount, bool blgnoreCase, Culturelnfo ei)
The bignoreCase argument affects the return value only when the two strings are the same except for case. Case-insensitive comparisons are much more useful for searching rather than sorting. The method calls string.Compare("e", "E") and string.Compare("e", "E", false)
both return negative values. but string.Compare("e", "E", true)
returns 0. The calls string.Compare("e", "e", bIgnoreCase) and string.Compare("e", "E", bIgnoreCase)
always return negative values. regardless of the presence or value of the bignoreCase argument.
There is no comparison method implemented in the String class that reports that "Andre" equals "Andre".
Post a comment