Created
May 21, 2017 19:02
-
-
Save LwServices/575bdc97610543c0345b4b1c9f470692 to your computer and use it in GitHub Desktop.
LinqPad_Test
This file contains hidden or 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
var namen = new string[] { "Lech", "Mai", "Theo", "Xenia", "Ewa", "Andrzej" }; | |
var d = namen.ToDictionary(k => k,v=> Regex.IsMatch(v, @"i")); | |
var g = namen.GroupBy(x => Regex.IsMatch(x, @"i")); | |
var l = namen.ToLookup(x=> Regex.IsMatch(x, @"i")); | |
var s = namen.Select(x => new { Key = x, Value=Regex.IsMatch(x, @"i") }); | |
var kv = namen.Select(x => new KeyValuePair<string,bool>(x, Regex.IsMatch(x, @"i") )); | |
Console.WriteLine(d); | |
Console.WriteLine(g); | |
Console.WriteLine(l); | |
Console.WriteLine(s); | |
Console.WriteLine(kv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment