Click to See Complete Forum and Search --> : Text Separation


Lynn
December 20th, 1999, 07:26 AM
Hi, I need to retrieve a string from a database which is comprised of several information. An example is 'USA/FRA/GER'. Now, I need to break these info into 'USA', 'FRA' and 'GER' respectively. How do I identify these info and separate them?
Thanks

Rgds
Lynn

Chris Eastwood
December 20th, 1999, 07:35 AM
If you're using VB6, you can use the 'Split' function :


Dim s as string
Dim sArray() as string
Dim l as Long

s = "USA/FRA/GER"

sArray = Split(s, "/")

for l = LBound(sArray) to UBound(sArray)
MsgBox sArray(l)
next




That 'chops' up the delimeted string into an array for you.


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Lynn
December 20th, 1999, 07:36 AM
Thanks Chris!

Lynn