Concatention by Using the Concat Operator : Concat « LINQ « C# / C Sharp






Concatention by Using the Concat Operator

 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {
        string[] presidents = {"ant", "arding", "rison", "eyes", "over", "ackson"};
        IEnumerable<string> items = new[] {
                                   presidents.Take(5),
                                   presidents.Skip(5)
                                  }.SelectMany(s => s);
        foreach (string item in items)
            Console.WriteLine(item);
    }
}

 








Related examples in the same category

1.use Concat with array elements
2.Use Concat to merge two integer arrays into a single sequence
3.Uses Concat to merge the names of all customers and products
4.Concat Prototype
5.Concat appends one sequence to another