formatΒΆ

The format filter formats a given string by replacing the placeholders (placeholders follows the sprintf notation):

{% set fruit = 'apples' %}
{{ "I like %s and %s."|format(fruit, "oranges") }}

{# outputs I like apples and oranges #}

See also

replace