'Does string txt contain all words in list s?
Private Sub ContainsAll(txt As String, s As List) As Boolean
Private does As Boolean = True
For Each item As String In s
does = does And txt.tolowercase.Contains(item.ToLowerCase)
Next
Return does
End Sub
Private Sub txt_Search_TextChanged (Old As String, New As String)
clv_Exercises.Clear
clvExercisesSelections.SelectedItems.Clear
If New.Length = 0 Then
For Each item As String In AllExercises
clv_Exercises.AddTextItem(item,item)
Next
Else
Private terms As List = Regex.Split(" ",New.Trim)
Private xlist As List
xlist.Initialize
For Each item As String In AllExercises
If ContainsAll(item,terms) Then
clv_Exercises.AddTextItem(item,item)
End If
Next
End If
End Sub