We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple proposal to return both matched and unmatched results from a where query in a one-liner.
var chars = new char[] { 'a', 'b', 'c' }; (matched, unmatched) = chars.Match(c => c == 'a'); for (var element in unmatched) ... //or IMatchResults results = chars.Match(c => c == 'a'); for (var element in results.Unmatched) ...
For readability I would normally do the following; but requires and extra pass
var chars = new char[] { 'a', 'b', 'c' }; var matched = chars.Where(c => c == 'a'); var unmatched = chars.Where(c => c != 'a');
You can achieve this in one pass using a for loop, but goes against the point of Linq and is longer
var chars = new char[] { 'a', 'b', 'c' }; var matched = new List<char>(); var unmatched = new List<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:
Closing out. Already moved this to the right repo.
Sorry, something went wrong.
Moved to dotnet/runtime#39443
No branches or pull requests
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: