ez.no / exponential / documentation / reference / template operators / strings / indent
$input_string|indent( count [, type] [, filler] )
| Name | Type | Description | Required |
|---|---|---|---|
| count | integer | Number of indentations. | yes |
| type | string | Type of indentation. | no |
| filler | string | Custom indentation. | no |
indented version of input string.
This operator indents the input string in some way and returns it. The indentation type can be either 'space', 'tab' or 'custom'. The default indentation is space. If the indentation type is set to 'custom', the filler parameter must be set to the desired indentation string.
{"This is my text"|indent( 1 )}
returns the string " This is my text"
{"This is my second text"|indent( 3, 'custom', '.' )}
returns the string "...This is my second text"
Comments