Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Manipulation

Status
Not open for further replies.

FUNBOY

Programmer
Dec 31, 2005
3
SA
Hi,
Does anyone know of a function or method that i can use that, when a user enters some words into a text box, stores each seperate word into a seperate variable in SQL?

Basically what i need to do is read in any characters between white spaces tand store them in seperate variables so i can search the database for each occurence of the word - any help would be great!

Thanks
 
Assuming you have VB available to use - you can use the Split function to put the separate words into an Array and loop thru as needed.

Dim Ary() As String
Dim Holder As String
Dim N As Integer

Ary = Split(Text1.Text, " ", -1)
For N = 0 To UBound(Ary())
Holder = Holder & "," & Ary(N)
Next N


This will put all words from the text string into the Array called "Ary". The "For" loop just gives an example of how it could be used.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top