SortedList<TKey, TValue>::ICollection<KeyValuePair<TKey, TValue>>::Remove Method (KeyValuePair<TKey, TValue>)

 

Removes the first occurrence of a specific key/value pair from the ICollection<T>.

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

private:
virtual bool Remove(
	KeyValuePair<TKey, TValue> keyValuePair
) sealed = ICollection<KeyValuePair<TKey, TValue>>::Remove

Return Value

Type: System::Boolean

true if keyValuePair was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if keyValuePair was not found in the original ICollection<T>.

This method determines equality using the default comparer Default for KeyValuePair<TKey, TValue>.

This method performs a binary search; however, the elements are moved up to fill in the open spot, so this method is an O(n) operation, where n is Count.

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