Skip to content

Instantly share code, notes, and snippets.

@ugurhasar
Last active September 22, 2017 21:55
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