Getting url from string

S

Scott

If Request.ServerVariables("URL") renders

/myserver/mywebpage.asp

How can I just return mywebpage.asp?

I can use the RIGHT function, but I'd like for it to work on any page,
regardless of the length of the page name.

Thanks for any input.
 
S

Steven Burn

Function StripIt(sWhat)
Dim sRes
sRes = Split(sWhat, "/")
StripIt = sRes(UBound(sRes))
End Function

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
E

Evertjan.

Steven Burn wrote on 29 jun 2004 in
microsoft.public.inetserver.asp.general:
Function StripIt(sWhat)
Dim sRes
sRes = Split(sWhat, "/")
StripIt = sRes(UBound(sRes))
End Function

Or if you are a Richt()winger:

Function StripIt(sWhat)
StripIt = Right(sWhat,len(sWhat)-InstrRev(sWhat,"/"))
End Function
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,369
Latest member
Carmen32T6

Latest Threads

Top