Alrighty, Say i have this array
1
5
7
10
15
Right? Can i compare the variable A = 7 to that array to see what position 7 is in the array?
Printable View
Alrighty, Say i have this array
1
5
7
10
15
Right? Can i compare the variable A = 7 to that array to see what position 7 is in the array?
Yes!
I believe you can do this:
VB Code:
Dim myArray() As Integer = {1, 5, 7, 10, 15} Dim intSearch as Integer = 7 Debug.WriteLine(Array.IndexOf(myArray, intSearch))