Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the InvariantCulture. : CaseInsensitiveHashCodeProvider « Collections Data Structure « C# / C Sharp






Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer, based on the InvariantCulture.

 

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

public class SamplesHashtable  {

   public static void Main()  {
      Hashtable myHT3 = new Hashtable( CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant );
      myHT3.Add("FIRST", "Hello");
      myHT3.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 Turkish culture (tr-TR), where "I" is not the uppercase version of "i".
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.