Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer : HashTable « Data Structure « VB.Net






Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer

 

Imports System
Imports System.Collections
Imports System.Globalization

Public Class SamplesHashtable

   Public Shared Sub Main()

      Dim myHT3 As New Hashtable(CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant)
      myHT3.Add("FIRST", "Hello")
      myHT3.Add("SECOND", "World")
      myHT3.Add("THIRD", "!")

   End Sub 'Main 

End Class 'SamplesHashtable

   
  








Related examples in the same category

1.Hashtable: add,get,count, Dictionary Key and value EnumeratorHashtable: add,get,count, Dictionary Key and value Enumerator
2.Store Environment Variables into a Hash tableStore Environment Variables into a Hash table
3.Create a Hashtable using the default hash code provider and the default comparer.
4.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer
5.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer based on the Turkish culture (tr-TR)
6.Create Hashtable class from another dictionary
7.Hashtable.Add Method adds an element with the specified key and value into the Hashtable.
8.Hashtable.Clear Method removes all elements from the Hashtable.
9.Hashtable.Contains Method Determines whether the Hashtable contains a specific key.
10.Hashtable.CopyTo Method copies the Hashtable elements to a one-dimensional Array instance at the specified index.
11.Hashtable.GetEnumerator Method returns an IDictionaryEnumerator that iterates through the Hashtable.
12.Displays the keys and values of the Hashtable using foreach statement
13.Hashtable.IsSynchronized Property gets a value indicating whether access to the Hashtable is synchronized (thread safe).
14.Hashtable.Remove Method removes the element with the specified key from the Hashtable.