I’ve got a search box which I need to check all words in it against a a string array
So far I’ve got the following code
For i As Integer = 0 To wordList.Length - 1
If wordList(i).Contains(TextBox1.Text) Then
Dim item As String() = New String(0) {}
item(0) = wordList(i)
items.Add(item)
End If
Next
This checks if the words contain what’s in the textbox in the order it is input but not individual words in any order.
Any ideas how I can check every word in any order and only show words from wordList that contain ALL words?
Thanks in advance
Use LINQ:
If you don’t want to match text in the middle, you’ll need to use a regex: