Skip to main content

replace

The replace filter will format a given string by replacing placeholders.

For example, if you had a string like the one below, and the customer.company name you were referencing was 'John Doe':

{{"I like %this%."|replace({'%this%': customer.company})}}

will print "I like John Doe."

A common use example of the replace filter is:

|replace("American Express", "AMEX")

will print "AMEX" in place of American Express.