Retrieve single value from Hashtable by key : Hashtable « Collections « VB.Net Tutorial






Option Strict On

Imports System.Collections

Public Module modMain
   Public Sub Main()
      Dim airports As New Hashtable

      airports.Add("JFK", "John F. Kennedy, New York")
      airports.Add("LAX", "Los Angeles International, Los Angeles")
      airports.Add("ORD", "O'Hare International, Chicago")
      airports.Add("LHR", "Heathrow Airport, London")

      Console.WriteLine(airports.Item("JFK"))

   End Sub
End Module
John F. Kennedy, New York








8.13.Hashtable
8.13.1.Add value pair to Hashtable and get value back by key
8.13.2.Retrieve single value from Hashtable by key
8.13.3.Retrieve all keys, sort and iterate
8.13.4.Retrieve all values, sort and iterate
8.13.5.Find value and key in a Hashtable
8.13.6.Get Enumerator from Hashtable
8.13.7.ContainsKey
8.13.8.Use For Each to loop through all keys in Hashtable
8.13.9.A case-sensitive hash table and a case-insensitive hash table