input|pad( length [, padding ] )
Name | Type | Description | Required |
---|---|---|---|
length | integer | The desired length of the string. | Yes. |
padding | character | Custom character to be used for padding. | No. |
This operator makes sure that the input string is at least "length" characters long by inserting extra characters at the end. It is possible to specify a custom character using the "padding" parameter (default is space). The operator returns a padded version of the input string.
{'Too short!'|pad( 15 )}
The following string will be produced: "Too short! ".
{'Too short!'|pad( 16, '-' )}
The following string will be produced: "Too short!------".
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.