url manipulation - extract final /folder/ only from u

Discussion in 'ASP General' started by jason, Dec 9, 2003.

  1. jason

    jason Guest

    jason, Dec 9, 2003
    #1
    1. Advertising

  2. jason

    Ray at Guest

    sURL = Request.ServerVariables("URL")
    aParts = Split(sURL, "/")
    sFinalDir = aParts(UBound(aParts)-1)

    I think that should work.

    Ray at work


    "jason" <> wrote in message
    news:...
    > How does one extract the the final /folder/ name in a URL string of

    unknown
    > length and folder division which may come in in slightly different (albeit
    > identical results) as in the following:
    >
    > For instance:
    >
    > www.catamarans.com/charter/bareboat/oceanspeed/index.asp
    > www.catamarans.com/charter/bareboat/oceanspeed/
    > www.catamarans.com/charter/bareboat/oceanspeed/?m=SM
    >
    > I would wish to only get back:
    >
    > "oceanspeed"
    >
    > I would appeciate code examples on this. Many thanks.
    >
    > Jason
    >
    >
    >
    >
     
    Ray at, Dec 9, 2003
    #2
    1. Advertising

  3. jason

    jason Guest

    Allright! That works beautifully - I'll get a lot of mileage of that
    script....many thanks - helps me a lot!

    Cheers
    Jason
    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > sURL = Request.ServerVariables("URL")
    > aParts = Split(sURL, "/")
    > sFinalDir = aParts(UBound(aParts)-1)
    >
    > I think that should work.
    >
    > Ray at work
    >
    >
    > "jason" <> wrote in message
    > news:...
    > > How does one extract the the final /folder/ name in a URL string of

    > unknown
    > > length and folder division which may come in in slightly different

    (albeit
    > > identical results) as in the following:
    > >
    > > For instance:
    > >
    > > www.catamarans.com/charter/bareboat/oceanspeed/index.asp
    > > www.catamarans.com/charter/bareboat/oceanspeed/
    > > www.catamarans.com/charter/bareboat/oceanspeed/?m=SM
    > >
    > > I would wish to only get back:
    > >
    > > "oceanspeed"
    > >
    > > I would appeciate code examples on this. Many thanks.
    > >
    > > Jason
    > >
    > >
    > >
    > >

    >
    >
     
    jason, Dec 9, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Varn
    Replies:
    2
    Views:
    657
    Ken Varn
    Jun 22, 2005
  2. JFCM
    Replies:
    4
    Views:
    5,778
  3. Replies:
    5
    Views:
    544
    Chris Uppal
    Nov 17, 2006
  4. IanR
    Replies:
    2
    Views:
    307
    Albert Hopkins
    Mar 12, 2009
  5. jason
    Replies:
    9
    Views:
    166
    Ray at
    Dec 10, 2003
Loading...

Share This Page