Use Linq Distinct to get the distinct value in an array : Distinct « LINQ « C# / CSharp Tutorial






using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;

public class MainClass{
   public static void Main(){
            int[] numbers = {1, 1, 2, 3, 3};
            Console.Write(numbers.Distinct());
   }
}








22.31.Distinct
22.31.1.Create the Distinct query
22.31.2.Use Linq Distinct to get the distinct value in an array
22.31.3.Set Operators: Distinct
22.31.4.Printing the unique Category names
22.31.5.Distinct Operator
22.31.6.Get Distinct departments
22.31.7.Get all Make and don't show duplicates