Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   url manipulation - extract final /folder/ only from u (http://www.velocityreviews.com/forums/t792085-url-manipulation-extract-final-folder-only-from-u.html)

jason 12-09-2003 07:45 PM

url manipulation - extract final /folder/ only from u
 
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:

http://www.catamarans.com/charter/ba...peed/index.asp
www.catamarans.com/charter/bareboat/oceanspeed/
http://www.catamarans.com/charter/ba...eanspeed/?m=SM

I would wish to only get back:

"oceanspeed"

I would appeciate code examples on this. Many thanks.

Jason





Ray at 12-09-2003 07:53 PM

Re: url manipulation - extract final /folder/ only from u
 
sURL = Request.ServerVariables("URL")
aParts = Split(sURL, "/")
sFinalDir = aParts(UBound(aParts)-1)

I think that should work.

Ray at work


"jason" <jason@catamaranco.com> wrote in message
news:Oiex3zovDHA.2444@TK2MSFTNGP12.phx.gbl...
> 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:
>
> http://www.catamarans.com/charter/ba...peed/index.asp
> www.catamarans.com/charter/bareboat/oceanspeed/
> http://www.catamarans.com/charter/ba...eanspeed/?m=SM
>
> I would wish to only get back:
>
> "oceanspeed"
>
> I would appeciate code examples on this. Many thanks.
>
> Jason
>
>
>
>




jason 12-09-2003 08:00 PM

Re: url manipulation - extract final /folder/ only from u
 
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:ejhMt4ovDHA.2308@TK2MSFTNGP11.phx.gbl...
> sURL = Request.ServerVariables("URL")
> aParts = Split(sURL, "/")
> sFinalDir = aParts(UBound(aParts)-1)
>
> I think that should work.
>
> Ray at work
>
>
> "jason" <jason@catamaranco.com> wrote in message
> news:Oiex3zovDHA.2444@TK2MSFTNGP12.phx.gbl...
> > 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:
> >
> > http://www.catamarans.com/charter/ba...peed/index.asp
> > www.catamarans.com/charter/bareboat/oceanspeed/
> > http://www.catamarans.com/charter/ba...eanspeed/?m=SM
> >
> > I would wish to only get back:
> >
> > "oceanspeed"
> >
> > I would appeciate code examples on this. Many thanks.
> >
> > Jason
> >
> >
> >
> >

>
>





All times are GMT. The time now is 02:14 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.