StringComparer.CurrentCultureIgnoreCase; : StringComparer « Collections Data Structure « C# / C Sharp






StringComparer.CurrentCultureIgnoreCase;

 

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;

class Sample 
{
    public static void Main() 
    {
      List<string> list = new List<string>();
      CultureInfo turkish = new CultureInfo("tr-TR");
      CultureInfo thisCulture = Thread.CurrentThread.CurrentCulture;
      StringComparer invCmp = StringComparer.CurrentCultureIgnoreCase;

      list.Add("I");
      list.Add("i");
      list.Add("\u0131");

      list.Sort(invCmp);
      Display(list);

   }
  
   public static void Display(List<string> lst){
      foreach (string s in lst){
          Char c = s[0];
          int codePoint = Convert.ToInt32(c);
          Console.WriteLine("0x{0:x}", codePoint); 
      }
    }
}

   
  








Related examples in the same category

1.StringComparer Represents a string comparison operation
2.StringComparer.InvariantCultureIgnoreCase;
3.StringComparer.CurrentCulture;
4.StringComparer.Ordinal;
5.StringComparer.OrdinalIgnoreCase
6.StringComparer.Create(turkish, true);