I would, personally, just use a lambda for the predicate:
Code:
List<string> files = new List<string>(new string[] { "blah.c", "info.txt", "foo.c", "slapmesilly.der", "bar.h" });
List<string> specificFiles = files.FindAll(f => f.EndsWith(".c") || f.EndsWith(".h"));
foreach (string file in specificFiles)
Console.WriteLine(file);
Result:
Of course, I prefer LINQ, which works on any type that implements IEnumerable<T>. Using the following code you get the same results as above:
Code:
string[] files = { "blah.c", "info.txt", "foo.c", "slapmesilly.der", "bar.h" };
foreach (string file in files.Where(f => f.EndsWith(".c") || f.EndsWith(".h")))
Console.WriteLine(file);