strRightFill

Fills the right side of a string with characters to make it a specified length.

Note:

Use the Special String Operators for string concatenation, string inclusion, and simple comparison.

Type and Usage

Parameters

Takes three parameters:

  • The first parameter is the string.

  • The second parameter is the fill character.

  • The third parameter is the length.

Output

Returns a string, right-filled with the specified character if necessary,.

Example

Formats the string sleep by right filling with the character Z to ten spaces. This returns the string sleepZZZZZ:

<$strRightFill("sleep",'Z',10)$>

Returns the string sleep:

<$strRightFill("sleep",'Z',4)$>