I've just spent ages on this too, must have changed in a recent update as it previously worked with the trailing slash. I've written a StripSlash replacement function to remove the trailing slash:
Print FileType(StripSlashes(path$))
Function StripSlashes$(path$)
'Replacement for StripSlash() but does not reformat text and removes both types of slash.
'Does not strip slash from a root' path (e.g. "/" or "C:/")
Local pathLen% = Len(path$)
If pathLen > 3 Then
Local char$ = Right(path$, 1)
If char$ = "\" Or char$ = "/" Then path$ = Left(path$, pathLen-1)
End If
Return path$
End Function
Last edited 2011
|