Heres the problem:
I have a string and i want to delete out some parts.
Example:IF i got the a string "www.vb-world.net" or someother string, how would i return only the word "net" to
a textbox and get rid of the words"www.vb-world."
Printable View
Heres the problem:
I have a string and i want to delete out some parts.
Example:IF i got the a string "www.vb-world.net" or someother string, how would i return only the word "net" to
a textbox and get rid of the words"www.vb-world."
How about this:
Code:strURL = "www.vb-world.net"
Text1.Text = Mid(strURL, InStrRev(strURL, ".") + 1)
If vb6 lookup the split function, l use vb5 therefore
Dim sString as String
Dim iPos, iLen as Integer
'
sString = "www.vb-world.net" ' or where ever ya get it
iLen = Len(sString)
'
iPos = Mid(sString,"net",1)
txtbox = Instr(sString,iPos,iLen)
Don't know if syntax is correct, don't have vb in front of me, but anyway will give you the general idea
Hope it Helps :)
There are a thousand different ways to do it... it depends on what exactly you want to pull out.. is it a certian phrase.. is it certian characters.. depends what your goal is.
You are exactly right Jethro, it does depend on the version Visual Basic. However, I've decided that from now on if a post doesn't specify a version of VB then I will just assume they are using VB6. I'm not going to write three versions (16-bit, 32-bit pre-VB6, and VB6) of an answer for every post. In this case, I just gave the most direct answer off the top of my head. If it doesn't work then the person will let us know.