s.getpath([file] [append]) s.getfilename([file] [ext])
s - str variable.
file - full path of a file or folder. Default: s.
append - some string to append. Use "" to remove "\".
ext - if nonzero, get filename with extension.
getpath extracts path part from file.
getfilename extracts filename part from file.
QM 2.3.4. Supports file streams, like "c:\a\b.txt:stream1:$DATA".
There are many Windows API functions that can be used to work with paths and URLs. For example, PathFindExtension. Documented in MSDN Library.
str s1.getpath("c:\folder\test.txt") str s2.getfilename("c:\folder\test.txt") str s3.getfilename("c:\folder\test.txt" 1) now s1 is "c:\folder\", s2 is "test", s3 is "test.txt"