Table of Contents

Method RemoveAllBut

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

RemoveAllBut<T>(List<T>, Predicate<T>)

Removes all the elements in the list that does not satisfy the predicate.

public static void RemoveAllBut<T>(this List<T> source, Predicate<T> predicate)

Parameters

source List<T>

The list to remove elements from.

predicate Predicate<T>

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.