有这个代码:
- 如何使用 LINQ 组合这些列表?
- 或者是否可以在没有 LINQ 的情况下做到这一点?
Dim a As New List(Of Integer)
Dim b As New List(Of Integer)
Dim c As New List(Of Integer)
a.Add(1)
b.Add(2)
c.Add(3)
有这个代码:
Dim a As New List(Of Integer)
Dim b As New List(Of Integer)
Dim c As New List(Of Integer)
a.Add(1)
b.Add(2)
c.Add(3)
这里有两种选择
添加到已经存在的数组:
或连接到一个新对象(Concat 函数,与 AddRange 不同,不会更改调用它的对象):
使用 Union() 函数
选择: