Returning the last file in a string location.

BlitzMax Forums/BlitzMax Beginners Area/Returning the last file in a string location.

Ryan Burnside(Posted 2008) [#1]
What is the best way to return the last file, given the file location as a string?

I use requestfile() to get the location from the user but I would like to have just the name of the file they wish to create?

so if requestfile() returned:
C:\Users\Ryan Burnside\Desktop\garbage.bmx

I would just like the name of the last file "garbage.bmx".


Jesse(Posted 2008) [#2]
filename$ = "C:\Users\Ryan Burnside\Desktop\garbage.bmx"
name$ = stripdir(filename$)
print name$


Ryan Burnside(Posted 2008) [#3]
Ahh thanks. I could not find the command with the new design of version 1.26's help document.