How to find a value on an array by it’s index on VB.Net?
// INDEX: 0 1 2 3 4
Dim DataArray(4) as Integer = {"A", "B", "C", "D", "E"}
Then, I randomize a number from 0 to 4. For example, when I got 3, then I will get D value on the array based on the randomize number. How can I do that? Thank you.
You can just access the value by having the index after the array name
Also there is a problem with your array, DataArray is declared as an integer array but storing alphabet, so you should change it to
or
The little c after “A” means it is a character