CollectionExtensionsRemoveWhereT Method

Iterates through each item in the list. Allowing items to be removed from the list.

Definition

Namespace: Gemstone.Collections.CollectionExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.147 -- Release Build+759c9d29b79c81f10905de8f58b653be932045f0
public static int RemoveWhere<T>(
	this List<T> list,
	Func<T, bool> shouldRemove
)

Parameters

list  ListT
the list to iterate though
shouldRemove  FuncT, Boolean
the function to call to determine if the items should be removed from the list.

Type Parameters

T
Type of ListT.

Return Value

Int32
The number of items removed from the list.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ListT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

In order to minimize the overhead of a removal. Any item removed with be replaced with the last item in the list. Sequence will not be preserved using this method.

See Also