Merge 2 arrays using LINQ

前端 未结 5 490
孤城傲影
孤城傲影 2021-01-04 00:59

I have two simple array and I would like to merge using join linq:

int[] num1 = new int[] { 1, 55, 89, 43, 67, -3 };
int[] num2 = new int[] { 11, 35, 79, 23         


        
5条回答
  •  鱼传尺愫
    2021-01-04 01:24

    var result = num1.Concat(num2);
    

    Doesn't allocate any memory. Is this sufficient for your needs?

提交回复
热议问题