.. _functx_substring-before-last: ============================ functx:substring-before-last ============================ The substring before the last occurrence of a delimiter Description ~~~~~~~~~~~ The functx:substring-before-last function returns the part of $arg that appears before the last occurrence of $delim. If $arg does not contain $delim, a zero-length string is returned. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:string() - the string to substring * - delim:string() - the delimiter Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:substring-before-last('abc-def-ghi', '-') - abc-def * - functx:substring-before-last('abcd-abcd', 'ab') - abcd- * - functx:substring-before-last('abcd-abcd', 'x') - zero-length string See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`substring-before`. * :ref:`functx_substring-before-if-contains`. * :ref:`functx_substring-after-last`.