Remove Method

OrderedDictionary.Remove Method (Object)

 

Removes the entry with the specified key from the OrderedDictionary collection.

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

abstract Remove : 
        key:Object -> unit
override Remove : 
        key:Object -> unit

Parameters

key
Type: System.Object

The key of the entry to remove.

Exception Condition
NotSupportedException

The OrderedDictionary collection is read-only.

ArgumentNullException

key is null.

The entries that follow the removed entry move up to occupy the vacated spot and the indexes of the entries that move are also updated.

If the OrderedDictionary collection does not contain an entry with the specified key, the OrderedDictionary remains unchanged and no exception is thrown.

The following code example demonstrates the modification of an OrderedDictionary collection. In this example, the Remove method is used to remove the entry with the key "keyToDelete" from the OrderedDictionary. This code is part of a larger code example that can be viewed at OrderedDictionary.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft