String.Compare can be or not be case-sensitive, and can incorporate anynumber of comparison options, including culture-sensitivity and sortingrules. That is, it is not comparing the exact strings necessarily, but canbe configured to do various sorts of comparisons. String.CompareOrdinalcompares the numeric values of the individual Unicode characters of thestrings. In other words, it is always case-sensitive, and neverculture-sensitive.
String.CompareOrdinal is faster (more efficient) when you don't need to do aculture-sensitive comparison, and you do want to do a case-sensitivecomparison.String.CompareTo is case-sensitive, using an Ordinal comparison, andculture-sensitive, but always uses the current culture. It is faster thanString.Compare, but less efficient than String.CompareOrdinal.
Tuesday, November 27, 2007
0 comments:
Post a Comment
Your feedback is very important to me. Please provide your feedback via putting comments.