Difference between List.All() and List.TrueForAll()

From the docs for List<T>.TrueForAll:

Supported in: 4, 3.5, 3.0, 2.0

So it was added before Enumerable.All.

The same is true for a bunch of other List<T> methods which work in a similar way to their LINQ counterparts. Note that ConvertAll is somewhat different, in that it has the advantage of knowing that it’s working on a List<T> and creating a List<TResult>, so it gets to preallocate whatever it needs.

Leave a Comment