filename . files . sncode
latest
Return the filename.
FILENAME
NAME
filename - Return the filename.
SYNOPSIS
filename (ext:bool, "file", …)
DESCRIPTION
This function returns the filename portion of a file. It remove the direction and extention.
If ext is true, filename will return the extention of the file.
You can have multiple ext parameter as in:
filename(file1, ext:true, file2, ext:false, file3);
If multiple files are passed, the function return an array.
If only one file is passed, the function return a string.
The parameter ext is valid from version 5.123.
EXAMPLES
Note: In the followings examples, the _ between the { should be removed to make it work.
res={_{ filename('a','b.txt', "/a/c.txt", "/a/d", "aa", "bb.png", "/aa/cc.txt", "/aa/dd", "/a/.ext"); }_}. return res=["a","b","c","d","aa","bb","cc","dd",""].
AUTHOR
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>