|
-
Jul 17th, 2004, 11:02 PM
#1
Thread Starter
New Member
locate a string within a string
Good day.
Iwant to know how to locate a string within a string. For example:
--
dim vrtual as string = "VB.NET and sql server programming"
--
I have a form that has a textbox that accepts string inputs, upon pressing the button the inputted string must be searched if it exists with the vrtual string. How do I do it, what command or function shoud I use?
tnx for the help
-
Jul 18th, 2004, 12:22 AM
#2
PowerPoster
If sXML.IndexOf("sql server") > -1 Then
End If
-
Jul 18th, 2004, 11:24 AM
#3
PowerPoster
HI,
Safer to test for case.
VB Code:
If ucase(sXML).IndexOf(ucase(textbox1.text)) > -1 Then
Messagebox.Show("It's There")
End If
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 18th, 2004, 11:31 AM
#4
Lively Member
Originally posted by taxes
HI,
Safer to test for case.
VB Code:
If ucase(sXML).IndexOf(ucase(textbox1.text)) > -1 Then
Messagebox.Show("It's There")
End If
I agree with that, if you set option compare to binary only.
Do you think my life is easy?
Do you think it's good to win?
do you think it's nice to kill?
Do you think learning is a must?
Do you think computers are nothing?
Do you think this post is stupid?
Do ypu think we're really humen?
DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !
-
Jul 18th, 2004, 12:07 PM
#5
PowerPoster
Originally posted by TLord
I agree with that, if you set option compare to binary only.
When I saw your post I automatically agreed with you but when I tested it I still needed to test for case even with Option Compare Text. Are you sure that Option Compare settings refer to object.Text values, or do they refer only to files? (I did rebuild my project after changing the Option Compare setting).
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
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
|