How can i combine two arrays in to a single array during compound selection ( without using Union ) ( The question was asked at interview).
var num1 = new int[] { 12, 3, 4, 5 };
var num2 = new int[] { 1, 33, 6, 10 };
I tried as
var pairs = from a in num1 from b in num2 select new {combined={a,b}};
Expected: combined need to be {12,3,4,5,1,33,6,10}
num1.Concat( num2 );
I'm not sure if there is a related LINQ keyword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With