When would you use a Predicate Delegate over an Action Delegate?
For example, why does List<string>.RemoveAll()
require a Predicate<string>
rather than an Action<string>
? I assume it is because Action<string>
can only return a void
. So is the only difference between them the return type of the delegate?
Sorry if this is too vague, I am trying to wrap my head around the nuances and the terms.