strLeftFill

Fills the left 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, left-filled with the specified character if necessary,.

Example

Formats the string sleep by left-filling with the character Z to ten spaces. This returns the string ZZZZZsleep:

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

Returns the string sleep:

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