Culture-Sensitive C# Method
using System
public static int Compare(string strA, string strB);
public static int Compare(string strA, string strB, bool ignoreCase);
public static int Compare(string strA, string strB, StringComparison comparisonType);
public static int Compare(string strA, string strB, bool ignoreCase, CultureInfo culture);
public static int Compare(string strA, string strB, CultureInfo culture, CompareOptions options);
public static int Compare(string strA, int indexA, string strB, int indexB, int length);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options);
Internationalization (I18n) Method Overview
The Compare method compares two specified String objects, ignoring or honoring their
case, and honoring culture-specific information about their formatting.
See Microsoft's
MSDN online documentation for more information.
I18n Issues
Use the overload versions of this method that utilize the CultureInfo argument
to ensure that sorting of non-English strings will be performed according to the Culture's rules.
Culture and Number Format Information
|