I need help to modify this code so that the match is case Independent. For example when searching for form a match will show up even if it was saved as Form or FORM. I have tried ToLowercase but that didn't solve it.
B4X:
Public TmpList As List
Public ListIndex As Int = 0
Public TableView As TableView
TmpList.Initialize
B4X:
Sub SearchDocuments
If TextboxDocuments.Text = "" Then
fx.Msgbox(MainForm, "Enter a document name to begin search", "")
Return
End If
TmpList.Clear
ListIndex = 0
TmpDocSearch = TextboxDocuments.Text
For i = 0 To TableView.Items.size - 1
Dim arr() As String = TableView.Items.Get(i)
If arr(2).Contains(TmpDocSearch) Then
TmpList.Add(i) 'Just add the index to the row
End If
If TmpList.Size > 0 Then
ListIndex = 0
TableView.SelectedRow = TmpList.Get(ListIndex) 'Select the row from the index
TableView.ScrollTo (TmpList.Get(ListIndex))
If TmpList.Size = 1 And TmpList.Size < 2 Then
End If
'UpdateTableview
Else
ListIndex = -1
TableView.SelectedRow = -1
'Display no items found etc.
End If
Next
If ListIndex =-1 Then
fx.Msgbox(MainForm, "No match was found", "")
Return
End If
End Sub
Last edited: