Sitecore 5.0 API

HashList.Contains Method 

Checks if the hash table contains a key.

[Visual Basic]
Public Function Contains( _
   ByVal sKey As String _
) As Boolean
[C#]
public bool Contains(
   string sKey
);

Parameters

sKey
A key.

Return Value

True, if the key exists in the hash table, otherwise false.

Example

  Hashtable hashTable = new Hashtable();
  hashTable.Add("0", "apples");
  hashTable.Add("1", "bananas");
  hashTable.Add("2", "pears");
  
  if (hashTable.Contains("1")) {
    hashTable.Add("3", "pineapple");
  }

See Also

HashList Class | Sitecore.Collections Namespace