Skip to Content
VB.NET Language in a Nutshell, Second Edition
book

VB.NET Language in a Nutshell, Second Edition

by Steven Roman PhD, Ron Petrusha, Paul Lomax
April 2002
Intermediate to advanced
688 pages
19h 51m
English
O'Reilly Media, Inc.
Content preview from VB.NET Language in a Nutshell, Second Edition

Name

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VB .NET Language in a Nutshell

VB .NET Language in a Nutshell

Steven Roman PhD, Ron Petrusha, Paul Lomax

Publisher Resources

ISBN: 0596003080Supplemental ContentCatalog PageErrata