944,127 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 52931
  • VB.NET RSS
Nov 15th, 2004
0

string comparison in VB.net

Expand Post »
I need suggestions on how to compare a string from a textbox to a combo box
list? I then need to take any items that the string is similiar to and display them in a message box? Im very confused on how to do this? I would appreciate any input>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gencor45 is offline Offline
2 posts
since Nov 2004
Dec 5th, 2004
0

Re: string comparison in VB.net

The InStr("String", "String you are looking for") will return > 0 if a string is found.

Hence if StingA = "a b c d xx d c b a"

Dim StringSearch as integer

StringSearch = Instr(StringA, "xx")

StringSearch should return 9 [the position in the string of "xx"].

Now all you have to do is use the ComboBox list index property to search each of the combo boxes values and identify if the string is present in them.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
darrindarrinnet is offline Offline
3 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Knowing what language is used on a computer
Next Thread in VB.NET Forum Timeline: Expert in Class Creation & Implementation Needed





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC