How do you concatenate Lists in C#?

前端 未结 6 1960
闹比i
闹比i 2020-12-23 13:09

If I have:

List myList1;
List myList2;

myList1 = getMeAList();
// Checked myList1, it contains 4 strings

myList2 = getMeAnother         


        
6条回答
  •  情歌与酒
    2020-12-23 13:30

    Concat returns a new sequence without modifying the original list. Try myList1.AddRange(myList2).

提交回复
热议问题