VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,714 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello everybody, I have a list of integers. The list is sorted in ascending order. I am looking for a search tool in VB.NET that will return the first index, where the value in list is >600. Of course I can do it with a loop, but I have a feeling that Microsoft thought about it before me. Thanks to all helpers. Moshe.
It offers this possibility:
Dim numbers As New List(Of Integer) From {100, 330, 610, 610, 700}
Dim index = numbers.FindIndex(Function(n) n > 600)
If index >= 0 Then
' found
'...
End If
The list does not have to be sorted.