I have an arraylist of objects, I would like to know the index within the arraylist of the object that contains a certain value, is there a built-in way to do the search?
I know I could simply iterate through the arraylist to find the correct value e.g. :
ReportToFind="6"
For i = 0 To ReportObjList.Count - 1
If ReportObjList.Item(i).ReportCode = ReportToFind Then
ReportName.Text = ReportObjList.Item(i).ReportName ' found it - show name
Exit For
End If
Next
Is the only other solution be to replace this code a binary search?
.Net 1.1