Skip to the content
Documentation

indent

No ratings yet

Summary

Returns an indented version of the input string.

Usage

input|indent( count [, type [, filler ] ] )

Parameters

Name Type Description Required
count integer Number of indentations. Yes.
type string Type of indentation ("space", "tab" or "custom"). No.
filler string Custom indentation. No.

Returns

An indented version of the input string.

Description

This operator indents the input string and returns it. The indentation type can be set to "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.

Examples

Example 1
{'This is my text'|indent( 1 )}

The following string will be returned: " This is my text".

Example 2
{'This is my second line'|indent( 3, 'custom', '.' )}

The following string will be returned: "...This is my second line".

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.