搜索多维数组以开始

Search MultiDimensional Array for Starts With

我将数据库 table 加载到字符串列表中,然后我想在列表中搜索以特定字母集开头的任何行

示例:查找以 'ab'

开头的所有行

这是我的代码:

Dim matchword as string
Dim listOutput As New List(Of String())   
For Each row In Table
        listOutput.Add({row.Item(0), row.Item(1)})
Next

'Item(0) is a word and Item(1) is a number

如何搜索列表以找到所有以 matchword

开头的条目(在第 1 列中)

编辑 有人提到 findAll,这是如何工作的?

For Each entry As String() In listOutput
    If entry(0).StartsWith(matchword) Then

    End If
Next

List(Of T).FindAll(Predicate(Of T))

Dim result As List(Of String()) = listOutput.FindAll(Function(entry As String())
                                                         Dim matchword As String = "ab"
                                                         Return entry(0).StartsWith(matchword)
                                                     End Function)