Is there any way in c# .NET 2.0! to combine multiple Predicates?
Let\'s say I have the following code.
List names = new List
In .NET 2.0, there are anonymous delegates which you can use there:
List filteredNames = names.FindAll(
delegate(string s) { return StartsWithE(s) OR StartsWithI(s); }
);
In fact, you can use it to replace your functions as well:
List filteredNames = names.FindAll(
delegate(string s) { return s.StartsWith("E") || s.StartsWith("I"); }
);