c# - Why does this return zero results? -
i have list<list<string>>
, when try search list<string>
returns no results.
any ideas?
thanks
list<list<string>> test = new list<list<string>>(); list<string> ff = new list<string>(); ff.add("1"); ff.add("abc 1"); test.add(ff); ff = new list<string>(); ff.add("2"); ff.add("abc 2"); test.add(ff); var result = test.where(x=>x.contains("abc")); //result.count(); 0
neither of lists contains element "abc".
if want find lists have element contains "abc" substring can this:
var result = test.where(x => x.any(y => y.contains("abc")));
Comments
Post a Comment