Index
Main Menu
Tutorial Videos
Tutorial videos are available here.
Knowledge Base
Visit our User Forum for discussions & solutions
October 6, 2014
SubstringBeforeLast - XpressDox
SubstringBeforeLast and SubstringAfterLast
These two functions help with manipulation of strings like file paths or IP addresses which have multiple occurrences of a delimiter.
For the following examples, assume the data element DocFilePath contains ‘C:\Documents\XpressDox\WordFile.docx’.
SubstringBeforeLast can be used to get the name of folder from a full file path, e.g.:
«SubstringBeforeLast(DocFilePath,'\')»
will get the value ‘C:\Documents\XpressDox’, and
«SubstringAfterLast(DocFilePath,'\')»
will return ‘WordFile.docx’.
Getting the extension of the file is equally straightforward, using SubstringAfterLast:
«SubstringAfterLast(DocFilePath,'.')»