What is the most efficient way to loop thru each char of a string and check to see if the char in scope is in an array?
It would be cool if I could do something like the code below:
Note: I'm trying to avoid using OR statements for each of the items in the array because my array has many items.
It would be cool if I could do something like the code below:
Code:
Dim MyString As String = "The quick brown fox"
Dim FindTheseChars() As String = {"q","x","w"}
For i as integer = 0 To MyString.Length - 1
If MyString.Char(i) = AnyItem In FindTheseChars Then
'Do something
End If
Next
Note: I'm trying to avoid using OR statements for each of the items in the array because my array has many items.