StringComparer.Create(turkish, true); : StringComparer « Collections Data Structure « C# / C Sharp






StringComparer.Create(turkish, true);

 

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.Create(turkish, true);

      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.CurrentCultureIgnoreCase;
5.StringComparer.Ordinal;
6.StringComparer.OrdinalIgnoreCase