Case Comparison : String Case « String « C# / CSharp Tutorial






using System;

  class Class1
  {
    [STAThread]
    static void Main(string[] args)
    {
      char smallA = 'a';
            char largeA = 'A';

            Console.WriteLine( "a = {0} A = {1}", (int) smallA, (int) largeA );

            string str1 = "This Is A String.";
            string str2 = "This is a string.";

            Console.WriteLine( "Case sensitive comparison of str1 and str2 = {0}", String.Compare( str1, str2 ));
            Console.WriteLine( "Case insesitive comparison of str1 and str2 = {0}", String.Compare( str1, str2, true ));
    }
  }








5.9.String Case
5.9.1.Create upper and lowercase versions of a string
5.9.2.Case Comparison
5.9.3.Change String case according to CultureInfo
5.9.4.String.ToUpper(CultureInfo)