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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -