.. _functx_pad-string-to-length: =========================== functx:pad-string-to-length =========================== Pads a string to a desired length Description ~~~~~~~~~~~ The functx:pad-string-to-length function returns $stringToPad appended with enough repetitions of $padChar to make its length $length. The function will truncate $stringToPad if its length is greater than $length. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - stringToPad:string() - the string to pad * - padChar:string() - the character(s) to use as padding * - length:integer() - the desired length Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:pad-string-to-length('abc', '*', 6) - abc*** * - functx:pad-string-to-length('abcdef', '*', 4) - abcd * - functx:pad-string-to-length('', '*', 4) - **** See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_pad-integer-to-length`. * :ref:`functx_repeat-string`.