0
votes

I'm trying to determine if a string ends with a forward slash in classic ASP.

if right(upath, 1)="/" then
    upath=left(upath,len(upath-1))
end if

The value of upath is in this instance is "/ct3test/aces/aces_roi/".

But I keep getting the error:

Microsoft VBScript runtime error '800a000d' Type mismatch: '[string: "/ct3test/aces/aces_r"]'

I've tried Chr(47) with the same results. It doesn't like the forward slash and escaping it with "\" doesn't seem to help.

Any help would be greatly appreciated.

1
Sad to me that someone down-voted your question. I'm seeing a lot of what I consider intolerance on this site. You posted your code. You had an honest mistake in it. That's part of what this site is for; collaboration. So it bugs me when people down-vote for stuff like this. So I upvoted it. - ScotterMonkey

1 Answers

2
votes
if right(upath, 1)="/" then
    upath=left(upath,len(upath)-1)
end if

The parenthesis was placed at a wrong place