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