我能夠使用findAll及其謂詞...但我想知道使它工作的機制。Findall的搜索謂詞如何在泛型列表中工作
List<BradCollection> b = myList.FindAll(SearchForMe);
List<BradCollection> SearchForMe(string str)
{
if (str.Contains("brad"))
return true;
else
return false;
}
其中是SearchForMe中的「str」參數?
返回類型應該是bool,而不是List <> – recursive 2009-10-18 14:44:45
我對你的代碼感到困惑。這是一個字符串列表,還是一列BradCollections? – 2009-10-18 15:40:42