RemoveWhere Method

HashSet<T>.RemoveWhere Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Removes all elements that match the conditions defined by the specified predicate from a HashSet<T> collection.

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

public int RemoveWhere(
	Predicate<T> match
)

Parameters

match
Type: System.Predicate<T>
The Predicate<T> delegate that defines the conditions of the elements to remove.

Return Value

Type: System.Int32
The number of elements that were removed from the HashSet<T> collection.

ExceptionCondition
ArgumentNullException

match is null.

Calling this method is an O(n) operation, where n is Count.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft