缩进每一行的字符串,默认是缩进4个空格。 可选的参数可以设置缩进的空格数量。 可选的第二个参数设置缩进使用的字符,如用 "\t" 来代替空格缩进。

参数顺序类型必选参数默认值说明
1integerNo4 设置缩进多少空格
2stringNo一个空格设置用什么字符来进行缩进

例子:
articleTitle:

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

模板:


_{$articleTitle}_

_{$articleTitle|indent}_

_{$articleTitle|indent:10}_

_{$articleTitle|indent:1:"\t"}_

输出:

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

    NJ judge to rule on nude beach.
    Sun or rain expected today, dark tonight.
    Statistics show that teen pregnancy drops off significantly after 25.

          NJ judge to rule on nude beach.
          Sun or rain expected today, dark tonight.
          Statistics show that teen pregnancy drops off significantly after 25.

        NJ judge to rule on nude beach.
        Sun or rain expected today, dark tonight.
        Statistics show that teen pregnancy drops off significantly after 25.