Skip to content

Instantly share code, notes, and snippets.

@ugurhasar
Last active September 22, 2017 21:55
Show Gist options
  • Save ugurhasar/0d66cf4bca88816a7c1af9bd85e5052d to your computer and use it in GitHub Desktop.
Save ugurhasar/0d66cf4bca88816a7c1af9bd85e5052d to your computer and use it in GitHub Desktop.
C# Linq ile Dizi İçinde Duplicate Satırları Silme
fooArray.GroupBy(x => x.Id).Select(x => x.First());
var intArray = new[] { 2000, 2011, 2011, 2012, 2009, 2009, 2000 };
var uniqueArray = intArray.Distinct().ToArray();
//or
uniqueArray = intArray.GroupBy(i => i).Select(grp => grp.Key).ToArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment