In LINQ, the Concat method or operator is used to concatenate or append two collection elements into a single collection, and it does not remove duplicates from the two sequences.
Following is the pictorial representation of the LINQ Concat method.
In the above diagram, two list elements are combined into a single collection.
Following is the syntax of using the LINQ Concat method to combine two sequences into a single sequence.
C# Code
VB.NET Code
If you observe the above syntax, we are concatenating two lists into a single list.
Following is an example of the LINQ Concat method.
C# Code
VB.NET Code
If you observe the above example, we are concatenating two sequences, “arr1” and “arr2” into a single sequence using the LINQ Concat method.
Following is the result of the LINQ Concat method example.
This is how we can use LINQ concat method to combine multiple sequences into a single sequence in c#, vb.net.