You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can achieve this in one pass using a for loop, but goes against the point of Linq and is longer
varchars=newchar[]{'a','b','c'};varmatched=newList<char>();varunmatched=newList<char>();foreach(var c in chars){if(c=='a'){
matched.Add(c);}else{
unmatched.Add(c);}}
The text was updated successfully, but these errors were encountered:
Simple proposal to return both matched and unmatched results from a where query in a one-liner.
For readability I would normally do the following; but requires and extra pass
You can achieve this in one pass using a for loop, but goes against the point of Linq and is longer
The text was updated successfully, but these errors were encountered: