Set Operators : Distinct : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Distinct »

 

Set Operators








    
 

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

public class MainClass {
    public static void Main() {

        int[] fl = { 2, 2, 3, 5, 5 };

        var uniqueFactors = fl.Distinct();

        Console.WriteLine("Prime factors of 300:");
        foreach (var f in uniqueFactors) {
            Console.WriteLine(f);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Distinct