Searches for a key
Imports System
Imports System.Collections
Imports System.Collections.Specialized
Public Class SamplesListDictionary
Public Shared Sub Main()
Dim myCol As New ListDictionary()
myCol.Add("A", "a")
myCol.Add("B", "b")
myCol.Add("C", "c")
Dim myArr(myCol.Count) As DictionaryEntry
myCol.CopyTo(myArr, 0)
If myCol.Contains("A") Then
Console.WriteLine("The collection contains the key ""Kiwis"".")
Else
Console.WriteLine("The collection does not contain the key ""Kiwis"".")
End If
End Sub 'Main
End Class
Related examples in the same category