Module Module1
Sub Main()
' Create Dictionary.
Dim dict As Dictionary(Of String, Integer) = New Dictionary(Of String, Integer)
dict.Add(
"Cat", 5)
dict.Add(
"Mouse", 1)
dict.Add(
"Leopard", 9)
dict.Add(
"Asp", 10)
' Loop over pairs.
For Each pair As KeyValuePair(Of String, Integer) In dict
' Pad right of key.
Console.Write(pair.Key.PadRight(10))
' Pad left of value.
Console.WriteLine(pair.Value.ToString().PadLeft(2))
Next
End Sub
End Module
Cat 5
Mouse 1
Leopard 9
Asp 10