Skip to content

Instantly share code, notes, and snippets.

@tmyt
Created June 18, 2015 02:34
Show Gist options
  • Save tmyt/a603b815a99c881afd4d to your computer and use it in GitHub Desktop.
Save tmyt/a603b815a99c881afd4d to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
var list = new List<string>
{
"hoge",
"fuga",
"piyo",
"foo",
"hoge",
"bar",
"piyo"
};
foreach (var str in list.GroupBy(s => s, s => s).Where(g => g.Count() > 1).Select(g => g.Key))
{
Console.WriteLine(str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment