User1954304945 posted
Hi, please copy the data into DataTable, then use LinQ to get the data you want. For example:
Dim array As String(,) = {{"Mike", "Amy"}, {"Mary", "Albert"}, {"Mary", "Albert"}, {"Mary", "Albert"}, {"Mary", "Amy"}}
Dim table As New DataTable()
table.Columns.Add("FirstName", GetType(String))
table.Columns.Add("LastName", GetType(String))
Dim i As Integer = 0
Dim str1 As String = ""
Dim str2 As String = ""
For Each item As String In array
If i Mod 2 = 0 Then
str1 = item
i += 1
Else
str2 = item
table.Rows.Add(str1, str2)
i = 0
str1 = ""
str2 = ""
End If
Next
Dim list As EnumerableRowCollection = From rows In table.AsEnumerable() Where rows("LastName") = "Amy" Select rows("FirstName")
Dim list1 As New List(Of String)()
For Each item As String In List
list1.Add(item.ToString())
Next