Extract File Name from Path 4D v17

Method for extracting the FileName using 4D v17 collection and member function

<code 4D>
//extractFileName from Path
C_TEXT($0;$1;$path)
$path:=$1
C_COLLECTION($col)
$col:=New collection
$col:=Split string($path;Folder separator)
$0:=$col[$col.length-1]
</code 4D>

Example of call

<code 4D>
C_TEXT($fileName)
$fullPath:=Data file // example
$fileName:=extractFileName($fullPath)
</code 4D>

Why not use the new function http://doc.4d.com/4Dv17/4D/17/Path-to-object.301-3729565.en.htmlPath to object> :?:

Indeed ! :slight_smile: