Hashtable.Remove Method

   
Hashtable.Remove Method

Class

System.Collections.Hashtable

Syntax

   hashtablevariable   .Remove(   key   ) 
hashtablevariable (required; Hashtable object)

A reference to a Hashtable object

key (required; Object)

The key whose key/value pair is to be removed

Return Value

None

Description

Removes an element from a hash table

Rules at a Glance

  • If key is found in the hash table, the member is removed, and the Count property is decreased by one.

  • If key is not found in the hash table, the hash table remains unchanged, and no exception is thrown.

Programming Tips and Gotchas

For cases in which you need to know whether the call to the Remove method has actually removed a key, you can call the ContainsKey method beforehand to make sure that the key you want to remove actually exists.

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net