Is it possible to iterate over two IEnumerable objects at the same time?

前端 未结 7 1916
醉梦人生
醉梦人生 2020-12-19 12:55

If I have a List(Of x) and a List(Of y) is it possible to iterate over both at the same time?

Something like

for each _x as X, _y as Y in List(of x         


        
7条回答
  •  有刺的猬
    2020-12-19 13:41

    You could use an old-fashioned for loop. Something like

    For ii As Integer = 0 To Math.Min(list1.Count, list2.Count)
        If list1(ii) = list2(ii) Then
        End If
    Next
    

提交回复
热议问题