C# Program to Demonstrate the Example of LINQ Concat() Method

Hi Hello, What I am going to do in this article I will see in detail about C# Program to Demonstrate the Example of LINQ Concat() Method. This article is a favorite of everyone and many people are suffering without knowing what the reason is. This article will be very useful for them.

C# Program to Demonstrate the Example of LINQ Concat() Method

C# Program to Demonstrate the Example of LINQ Concat() Method

//C# Program to demonstrate the Linq Concat() method.

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

class Demo
{
    static void Main(string[] args)
    {
        List<string> List1 = new List<string>() { "Abc", "Pqr", "Lmn", "Xyz" };
        List<string> List2 = new List<string>() { "Abc", "pqr" , "KLP" };

        var result = List1.Concat(List2);

        foreach (string value in result)
        {
            Console.WriteLine(value + " ");
        } 
    }
}
Abc
Pqr
Lmn
Xyz
Abc
pqr
KLP
Press any key to continue . . .

Final Words

By knowing clearly about C# Program to Demonstrate the Example of LINQ Concat() Method through this article. If you have any doubts please leave a comment via the comment box. Thank You.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment