Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

Hashtable.Remove Method

Class

System.Collections.Hashtable

Syntax

hashtableVariable.Remove(key)

key (required; any)

The key with the key/value pair that is to be removed

Description

The Remove method removes an element from a hashtable based on its key.

Usage at a Glance

  • If key is not found in the hashtable, the hashtable remains unchanged, and no error occurs.

  • For cases in which you need to know whether the call to the Remove method will actually remove an entry, call the ContainsKey method beforehand to make sure that the key you want to remove exists.

See Also

Hashtable Class

Категории