C# Console Linq List

C# Join Two Lists Together

In C for adding a list to another list, can be used addRange or Concat method. You can concatenate Lists in C# by following ways.

 

AddRange: Adds the elements of the specified collection to the end of the List<T>.

Example 1: Can be used this code joining two lists together

 

Concat: Concatenates two sequences.

Example 2: Concatenates two sequences via LINQ syntax

 

 

Example 3: Only using concat method (Simplest way)

 

 

Output:

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.