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.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
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