Hello my friends,
My question is really basic but I wanted to ask the opinion of real programmers.
I have a list of items.
Example :
Var People() As String = Array("John", "Sally", "Fred", "Nancy")
I know a method to check if an element belongs to the list, it is to loop to find out if it belongs to the list or not.
For i = 0 To People(i)
if Name = People(i) Then...
Or I could use a Dictionary
or even a String
with if Instr(People, Name) <> 0
Then…
Or I use Join
to merge the words in the list into String and I use InStr
.
I would like to work only with Arrays, isn’t there a clean way to find an element in an Array?
If Name in People Then....