getFileNameFromPath()
The function returns the file name and extension from the given path. This function does not check if the path/file exists.
Synopsis
string getFileNameFromPath(string path);
Parameters
Parameter | Description |
---|---|
path | The path for which the file is returned. |
Return value
A file name e.g. "test/subdir/file.ext" -> "file.ext"
Description
The function returns the file name and extension from the given path. This function does not check if the path/file exists.
Example
The following example returns the file name of the specified path.
-
main(mapping event) { string p = "D:/WinCCOA_Dir/textDatei.txt"; string f = getFileNameFromPath(p); DebugN("File name and extension:", f); }
Assignment
File function
Availability
CTRL, UI