 | CollectionExtensionsRemoveAllButT Method |
Removes all the elements in the list that does not satisfy the predicate.
Namespace:
Gamelogic.Extensions.Algorithms
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntaxpublic static void RemoveAllBut<T>(
this List<T> source,
Predicate<T> predicate
)
Parameters
- source
- Type: System.Collections.GenericListT
The list to remove elements from. - predicate
- Type: SystemPredicateT
The predicate used to filter elements.
All elements that don't satisfy the predicate will be matched.
Type Parameters
- T
- The type of elements in 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).
See Also