title: Groovy: Variable Substitution in dynamic Strings
body: <p>I'm currently facing a variable substitution related problem in groovy. While this is quite trivial:</p>
  
  <pre><code>Map map = [s1:"Hello", s2:"World"]
  println "${map.s1} ${map.s2}!" // "Hello World!"
  </code></pre>
  
  <p>As this works, I'm pretty sure that something like this should work as well:</p>
  
  <pre><code>Map map = [s1:"Hello", s2:"World"]
  def dynamic = loadStringFromFile();
  
  println "${dynamic} ${dynamic.class}" // "${s1} ${s2}! (java.lang.String)"
  
  // now the voodoo part
  println applyVoodoo(dynamic, map) // "Hello World!"
  </code></pre>
  
  <p>Does anybody know how to get this working?</p>
  
  <p>Cheers</p>