christiaanm
Member
I would like to search trough a list what contains +1000 items
and if i press the button it should give the index of the list.
i can't use indexOf because i only know a part of the string, not everyting, for example "ber 20 of"
I tried it with looping trough the list and contain parameter but its really slow.
is there a way i can do it very quickly, i am not attached to a list and can be any kind of object
Thanks everybody!
InitList:
Dim i As Int
testList.Initialize
For i = 0 To 2000
testList.Add("This is test number " & i & " of the list")
Next
and if i press the button it should give the index of the list.
i can't use indexOf because i only know a part of the string, not everyting, for example "ber 20 of"
I tried it with looping trough the list and contain parameter but its really slow.
The search part:
Sub getListIndex(whatList As List, WhatToFind As String) As Int
Dim i As Int
For i = 0 To whatList.Size -1
If whatList.Get(i).As(String).ToLowerCase.Contains(WhatToFind.ToLowerCase) = True Then
Return i
End If
Next
Return -1
End Sub
is there a way i can do it very quickly, i am not attached to a list and can be any kind of object
Thanks everybody!