Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
vendor
/
twig
/
twig
/
doc
/
filters
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/vendor/twig/twig/doc/filters/replace.rst
``replace`` =========== The ``replace`` filter formats a given string by replacing the placeholders (placeholders are free-form): .. code-block:: jinja {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} {# outputs I like foo and bar if the foo parameter equals to the foo string. #} {# using % as a delimiter is purely conventional and optional #} {{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }} {# outputs I like foo and bar #} Arguments --------- * ``from``: The placeholder values .. seealso:: :doc:`format<format>`