Searches for a key : ListDictionary « Data Structure « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Data Structure » ListDictionaryScreenshots 
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.CountAs 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
1.Display the contents of the collection using For Each. This is the preferred method
2.Display the contents of the collection using the enumerator
3.Display the contents of the collection using the Keys, Values, Count, and Item properties
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.