var numbers = new[] { 0, 1, 2, 2, 2, 3, 4, 4, 5 };
var uniqueNumbers =
from n in numbers
group n by n into nGroup
where nGroup.Count() == 1
select nGroup.Key;
// { 0, 1, 3, 5 }
More Related Contents:
- Getting unique items from a list [duplicate]
- Remove duplicate items from list in C#, according to one of their properties
- 2 ways of list making in c# [duplicate]
- What is the best way to organize a lot of data which contains multiple conditions?
- C# List sorting with multiple range
- List or IList [closed]
- Create an array or List of all dates between two dates [duplicate]
- C# List of objects, how do I get the sum of a property
- How do arrays in C# partially implement IList?
- How can I get every nth item from a List?
- How can I add an item to a IEnumerable collection?
- Binding List to DataGridView in WinForm
- List OrderBy Alphabetical Order
- Linq select objects in list where exists IN (A,B,C)
- How to initialize a list of strings (List) with many string values
- Does Distinct() method keep original ordering of sequence intact?
- Split string, convert ToList() in one line
- When a class is inherited from List, XmlSerializer doesn’t serialize other attributes
- Generate N random and unique numbers within a range
- Check if list contains any of another list
- How can I sort a List by multiple T.attributes?
- Easiest way to Rotate a List in c#
- How to Serialize List?
- Console.WriteLine and generic List
- How to find List has duplicate values in List [duplicate]
- WriteLine with a class
- Sort one list by another
- Cast Object to Generic List
- How to convert c# generic list to json using json.net?
- How do I transform a List into a DataSet?