Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trim/substring URL address to just file name & extension 1

Status
Not open for further replies.

davidagnew37

Technical User
Aug 11, 2004
16
GB
Hi

I cant seem to find an example to trim or substring an full URL address to just the file name and extension.

for example a variable that holds the address URL:

C:\Reports\Finance\test.rpt

to just return a variable with the file and its extension:

test.rpt

any help would be great.
Thanks
 
Hello davidagnew37,

If it is a string to string thing, then try something like this.
[tt]
s="C:\Reports\Finance\test.rpt"
a=split(s,"\")
filename=a(ubound(a))
wscript.echo filename
[/tt]
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top