vb.net基于3个子项从2d列表中删除

时间:2014-01-17 07:16:34

标签: vb.net

我有两个对象列表列表,基于list1的三个子项,如果这些子项存在于list2的项目上,则从list2中删除它。我一直在list2中找到list1中存在的行,而且我没有想法。

Dim list1 As New List(Of List(Of Object))
Dim list2 As New List(Of List(Of Object))
Dim it As Integer = Nothing : Dim it2 As Integer = Nothing
While it < List1.count
    While it2 < list2.Count
        If list1(it).Item(0).ToString = list2(it2).Item(0).ToString And list1(it).Item(3).ToString = list2(it2).Item(3).ToString And list1(it).Item(6).ToString = list2(it2).Item(6).ToString Then
            list2.RemoveAt(it2)
        End If
        it2 += 1
    End While
    it += 1 : it2 = 0
End While

0 个答案:

没有答案