StringDictionary Class implements a hash table with the key and the value
Imports System
Imports System.Collections
Imports System.Collections.Specialized
Public Class SamplesStringDictionary
Public Shared Sub Main()
Dim myCol As New StringDictionary()
myCol.Add("red", "R")
myCol.Add("green", "G")
myCol.Add("blue", "B")
PrintKeysAndValues1(myCol)
End Sub 'Main
Public Shared Sub PrintKeysAndValues1(myCol As StringDictionary)
Dim de As DictionaryEntry
For Each de In myCol
Console.WriteLine(" {0,-25} {1}", de.Key, de.Value)
Next de
End Sub
End Class
Related examples in the same category