Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the Turkish culture (tr-TR), where "I" is not the uppercase version of "i". : CaseInsensitiveHashCodeProvider « Collections Data Structure « C# / C Sharp






Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the Turkish culture (tr-TR), where "I" is not the uppercase version of "i".

 


using System;
using System.Collections;
using System.Globalization;

public class SamplesHashtable  {

   public static void Main()  {
      CultureInfo myCul = new CultureInfo( "tr-TR" );
      Hashtable myHT4 = new Hashtable( new CaseInsensitiveHashCodeProvider( myCul ), new CaseInsensitiveComparer( myCul ) );
      myHT4.Add("FIRST", "Hello");
      myHT4.Add("SECOND", "World");
   }

}

   
  








Related examples in the same category

1.Create Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the culture of the current thread.
2.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the InvariantCulture.
3.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer,
4.CaseInsensitiveComparer Class compares two objects for equivalence, ignoring the case of strings.