Use Linq to union two arrays : Union « 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, 3, 3};
            int[] numbers2 = {1, 2, 3, 4};
            Console.Write(numbers.Union(numbers2));
   }
}








22.20.Union
22.20.1.Create the Union query
22.20.2.Use Linq to union two arrays
22.20.3.prints the unique elements of two integer arrays
22.20.4.prints unique letters from Product and Customer names
22.20.5.Union Operator
22.20.6.Union does appends one sequence to another with duplicates removed:
22.20.7.Set Operators: Union