Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LwServices/575bdc97610543c0345b4b1c9f470692 to your computer and use it in GitHub Desktop.
Save LwServices/575bdc97610543c0345b4b1c9f470692 to your computer and use it in GitHub Desktop.
LinqPad_Test
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