Results 1 to 7 of 7

Thread: [RESOLVED] Remove text from String

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    110

    Re: Remove text from String

    Quote Originally Posted by MartinLiss
    Here's a better way.

    Code:
        Dim MyString As String
        Dim lngIndex As Long
        MyString = "www.newfoundland.com/help/431234.html"
        
        lngIndex = InStrRev(MyString, "/")
        
        MyString = Left$(MyString, lngIndex - 1)
    
        MsgBox MyString
    Thanks! It works perfectly

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    110

    Re: [RESOLVED] Remove text from String

    Quote Originally Posted by MartinLiss
    So does TBeck's and if you change Text1.Text in his to MyString then his is arguably a better (more compact) solution.
    I'm Sorry I didn't see TBeck's post.

    That works perfectly too!

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