Compare method from CompareInfo : CompareInfo « I18N Internationalization « C# / CSharp Tutorial






using System;
using System.Text;
using System.Globalization;

public class App{
    static void Main(string[] args){
        String[] sign = new String[] { "<", "=", ">" };

        String s1 = "C", s2 = "c", s3 = "c";

        CompareInfo ci = new CultureInfo("fr-FR").CompareInfo;
        Console.WriteLine("The LCID for {0} is {1}.", ci.Name, ci.LCID);

        Console.WriteLine("fr-FR Compare: {0} {2} {1}",s1, s2, sign[ci.Compare(s1, s2, CompareOptions.IgnoreCase) + 1]);

        Console.WriteLine("fr-FR Compare: {0} {2} {1}",s2, s3, sign[ci.Compare(s2, s3, CompareOptions.None) + 1]);

    }
}








21.4.CompareInfo
21.4.1.Compare method from CompareInfo
21.4.2.CompareInfo from CultureInfo
21.4.3.Uses the CompareInfo property of the InvariantCulture