-
Help!
I need to find a way to obtain a file name given the path to the file.
For example if the path to the file is
D:\blah\foo\bar\file.fff
then i need to return "file.fff"
I also need to be able to do this with URL's so
http://blah/foo/bar/file.fff
will also return "file.fff"
Thanks!
-
Shoud work with both
Code:
Function Filepart(filepath)
For n = Len(filepath) To 1 Step -1
If Mid(filepath, n, 1) = "\" Then Exit For
Next n
Filepart = Mid(filepath, n + 1)
End Function
-
thanks for the help. i added a clause to handle the fact that url's use forward slash instead of backslash. otherwise it works perfectly.