Dictionary<'TKey, 'TValue>.ICollection<KeyValuePair<'TKey, 'TValue>>.Remove Method (KeyValuePair<'TKey, 'TValue>)
Removes a key and value from the dictionary.
Assembly: mscorlib (in mscorlib.dll)
private abstract Remove : keyValuePair:KeyValuePair<'TKey, 'TValue> -> bool private override Remove : keyValuePair:KeyValuePair<'TKey, 'TValue> -> bool
Parameters
- keyValuePair
-
Type:
System.Collections.Generic.KeyValuePair<'TKey, 'TValue>
The KeyValuePair<'TKey, 'TValue> structure representing the key and value to remove from the Dictionary<'TKey, 'TValue>.
Return Value
Type: System.Booleantrue if the key and value represented by keyValuePair is successfully found and removed; otherwise, false. This method returns false if keyValuePair is not found in the ICollection<'T>.
Implements
ICollection<'T>.Remove('T)The following example shows how to use the ICollection<KeyValuePair<'TKey, 'TValue>>.Add, ICollection<KeyValuePair<'TKey, 'TValue>>.Contains, ICollection<KeyValuePair<'TKey, 'TValue>>.CopyTo, and ICollection<KeyValuePair<'TKey, 'TValue>>.Remove methods of the ICollection<'T> generic interface to manipulate a Dictionary<'TKey, 'TValue> object.
Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: