Share via


Remove Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Removes the element with the specified key from the Hashtable.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Sub Remove ( _
    key As Object _
)
public void Remove(
    Object key
)
public:
virtual void Remove(
    Object^ key
) sealed
abstract Remove : 
        key:Object -> unit 
override Remove : 
        key:Object -> unit 
public final function Remove(
    key : Object
)

Parameters

Implements

IDictionary. . :: . .Remove(Object)

Exceptions

Exception Condition
ArgumentNullException

key is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

NotSupportedException

The Hashtable is read-only.

-or-

The Hashtable has a fixed size.

Remarks

If the Hashtable does not contain an element with the specified key, the Hashtable remains unchanged. No exception is thrown.

This method is an O(1) operation.

.NET Framework Security

See Also

Reference

Hashtable Class

System.Collections Namespace