List<string>
-
I want use the metod public T Find (Predicate match) to find an string in myList. But I have no idea how can I find a string as a parameter. I know only this way: List mylist = myList.FindAll(demo); Is this way possible: List mylist = myList.FindAll(demo(object x)); Edit/Delete Message -- modified at 3:51 Thursday 7th December, 2006
-
I want use the metod public T Find (Predicate match) to find an string in myList. But I have no idea how can I find a string as a parameter. I know only this way: List mylist = myList.FindAll(demo); Is this way possible: List mylist = myList.FindAll(demo(object x)); Edit/Delete Message -- modified at 3:51 Thursday 7th December, 2006
From the documentation, it doesn't look like it would work, but I would try it to see if it did. Maybe the error message will give you insight. As a (bad) workaround, create a search criteria member variable of your class. for example:
private string FindAllSearchCriteria;
Set that before the findAll
this.FindAllSearchCriteria = "whatever";
then call
List mylist = myList.FindAll(demo);
Inside your demo method, use the this.FindAllSearchCriteria as your criteria for the search.