I have a string in twig that needs to be replaced with some words.
{% set myvar = 'Hello World' %}
{% set firstvar = 'Hello' %}
{% set secondvar = 'Test' %}
If I want to replace Hello with the test below code doesn't work.
{{ myvar|replace({"{{firstvar}}":"{{secondvar}}"}) }}
My expected output is : Test World
What is the wrong with the code. I ve searched everywhere but I couldn't find it.