Completes the text by the left with the fill value until obtain a text of the indicated length. Returns the resulting string. If the fill value consists of more than one character, the result can be greater than the indicated, if the total fill characters are not exactly the number of positions which had to be filled in order to obtain a text of the indicated length. The length of the fill characters is a multiple of the length of the fill string, it means that if the fill string consist in 2 characters, the total fill characters will be 2,4,6,8 ...

1 string.rpad

<string.rpad>
    <text /> !
    <size /> !
    <fill /> !
</string.rpad>

Exceptions

requires 3 arguments, received: ...

The 3 entry parameters has not been specified.

Example
Copy
<xsql-script name='string_rpad_sample1'>
    <body>
        <set name='text'>hello world, I'm HAL</set>
        <set name='size'>25</set>
        <set name='fill'>$</set>
        <println><string.rpad><text/><size/><fill/></string.rpad></println>

        <!-- In this another example, the total size exceeds the indicated. -->
        <set name='text'>hello world, I'm HAL</set>
        <set name='size'>25</set>
        <set name='fill'>XYZ</set>
        <println><string.rpad><text/><size/><fill/></string.rpad></println>
    </body>
</xsql-script>

Returns:

Copy
hello world, I'm HAL$$$$$
hello world, I'm HALXYZXYZ