User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 427,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,934 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 30891 | Replies: 1
Reply
Join Date: Nov 2004
Posts: 2
Reputation: gencor45 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gencor45 gencor45 is offline Offline
Newbie Poster

string comparison in VB.net

  #1  
Nov 15th, 2004
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>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 3
Reputation: darrindarrinnet is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
darrindarrinnet darrindarrinnet is offline Offline
Newbie Poster

Re: string comparison in VB.net

  #2  
Dec 5th, 2004
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 6:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC