Results 1 to 5 of 5

Thread: A string problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Posts
    4
    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."


  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    How about this:
    Code:
    strURL = "www.vb-world.net"
    Text1.Text = Mid(strURL, InStrRev(strURL, ".") + 1)

  3. #3
    Guest

    Wink Depends on version of vb

    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

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    Rochester NY, USA
    Posts
    93
    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.

  5. #5
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217

    Talking

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width