Created
January 9, 2015 10:03
-
-
Save DanPuzey/0fbf9e3d93970b2fa6bc to your computer and use it in GitHub Desktop.
For consideration in response to https://gist.github.com/lucasmeijer/e7bb3a981c2b2887642d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<string> ErrorsFor3(string[] hayStack, string[] needles, Func<string, string, string> errorMessageGenerator) | |
{ | |
return hayStack.Select(hay => needle.FirstOrDefault(hay.Contains)) | |
.Where(n => n != null) | |
.Select(matchingNeedle => errormessageGenerator(hay, matchingNeedle)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment