what is concat

Concat method is used to concat two data sources. In my last article I used union method to concat two data sources.

Concat V/S Union

Both methods are used to concat data but when we use concat method it will concat without removing redundancy but union method remove redundancy.

Note: - For union method check the article Set Operation in LINQ

Example of Concat method

		
	//data source first
        int[] ar1 = { 1, 2, 3, 4, 5 };

        //data sourse second
        int[] ar2 = { 4, 5, 6, 7, 8 };

        //concat method implementation
        IEnumerable<int> res = ar1.Concat(ar2);
        foreach (int p in res)
        {

            Response.Write(p + "<br/>");
        
        }

		
		

The output will be as follows:-

		
		concat in linq
		Figure 1
		
		

Email Address

For any query you can send mail at info@techaltum.com
Thanks