Results 1 to 2 of 2

Thread: Trimming URL

  1. #1
    Juuno is offline Member
    Join Date
    Feb 2009
    Posts
    18
    Rep Power
    0

    Default Trimming URL

    I would like to trim some specific strings in my url string.

    Say I get an input url which will be accepted and stored in some string variable.,
    Eg. "// en.wikipedia.org/wiki/Japan"
    Then all I want to get as my output is : Japan

    And same if the input url is like: "// .amazon.com/index.html" then all I want to get as my output is: index.html

    Can I do this? If so, how?
    Thanks in advance.

  2. #2
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    6

    Default

    Use a loop that removes every character before the last slash ('/')

    Or use regex of course.
    I die a little on the inside...
    Every time I get shot.

Posting Permissions

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