Skip to content

Instantly share code, notes, and snippets.

@meklarian
Created December 1, 2010 21:04
Show Gist options
  • Save meklarian/724217 to your computer and use it in GitHub Desktop.
Save meklarian/724217 to your computer and use it in GitHub Desktop.
LINQPad snippet that declares two string arrays, spits out their mutually exclusive parts.
var set1 = new string[]{"a","b","c","d"};
var set2 = new string[]{"a","e","i","o","u"};
var q = set1.Except(set2);
Console.WriteLine(q.Count());
Console.WriteLine("");
foreach(string s in q)
{
Console.WriteLine(s);
}
Console.WriteLine("");
var r = set2.Except(set1);
Console.WriteLine(r.Count());
Console.WriteLine("");
foreach(string s in r)
{
Console.WriteLine(s);
}
Console.WriteLine("");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment