Removes all items that match a predicate from a collection.
- Namespace
- Statiq
.Common - Containing Type
- I
Collection Extensions
Syntax
public static int RemoveAll<T>(this ICollection<T> collection, Func<T, bool> match)
Type Parameters
Name | Description |
---|---|
T | The type of the collection items. |
Parameters
Name | Type | Description |
---|---|---|
collection | ICollection |
The collection to remove items from. |
match | Func |
The predicate (return true to remove the item). |
Return Value
Type | Description |
---|---|
int | The number of items removed. |