TPLix

No results for ""

Substr

2 min read Jun 2, 2026
--- title: substr autoseo: enabled: true theme: learn2 child_type: default admin: children_display_order: collection visible: true ---

substr — Returns a part (substring) of the given string starting at a given offset.

Basic Usage:
{"Tplix"|substr:2} # renders: ix
{"Tplix"|substr:1:3} # renders: pli
Parameter Type Required Description
1 int yes offset (zero based, can be negative)
2 int no length of substring returned (unlimited of omitted)
Examples:

When used with a negative offset, the substring starts n characters from the end of the string counting backwards.

Where the template is:

{"Tplix"|substr:-2} # renders: ix
{"Tplix"|substr:-2:1} # renders: i

Leave a Comment

Not published. Used to notify you on approval.

Comments are moderated before appearing.