|
-
May 24th, 2009, 03:12 AM
#1
Thread Starter
Hyperactive Member
contains
im useing this code right now
If i.Contains("1") Then
MsgBox("2")
Else
End If
but what i want to do it have it check multiple text like this
If i.Contains("1") or ("2") or ("3")Then
MsgBox("H2")
Else
End If
but that doesnt work anyone want to help
-
May 24th, 2009, 03:14 AM
#2
Junior Member
Re: contains
If i.Contains("1") or i.Contains("2") or i.Contains("3")Then
MsgBox("H2")
End If
I think this should work.
-
May 24th, 2009, 03:33 AM
#3
Re: contains
This is easier then writing out or statements for each one, and it can be as long as you want:
vb.net Code:
Dim chrContains() As Char = {"1"c, "2"c, "3"c} If i.IndexOfAny(chrContains) Then MessageBox.show("H2") End If
-
May 24th, 2009, 04:32 AM
#4
Thread Starter
Hyperactive Member
Re: contains
thanks guys they both worked
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|