The most reliable way to clear the <T> list depending on the Predicate <T>
I have List<T> dataandPredicate<T> condition.
How should I use for cleaning datadepending on the result condition?
Option 1:
var del = data.Where(i => condition); data.RemoveAll(i => del.Contains(i));Option 2:
var del = data.Where(i => condition); for (int i = 0; i < del.Count; i++) data.Remove(del[i]);Option 3:
var del = data.Where(i => condition); foreach (var i in del) data.Remove(i);Option 4:
data = data.Where(i => !condition);Any others?
+3