VB.NET - If string contains "value1" or "value2"
You have to do it like this:
If strMyString.Contains("Something") OrElse strMyString.Contains("Something2") Then
'[Put Code Here]
End if
In addition to the answers already given it will be quicker if you use OrElse
instead of Or
because the second test is short circuited. This is especially true if you know that one string is more likely than the other in which case place this first:
If strMyString.Contains("Most Likely To Find") OrElse strMyString.Contains("Less Likely to Find") Then
'Code
End if
You need this
If strMyString.Contains("Something") or strMyString.Contains("Something2") Then
'Code
End if