title: Replacing names of the variable with value of the variable in a String in Java
body: <p>I have a String like this: <code>"#{var1} is like #{var2}</code>.<br>
  I would like to replace the <code>"#{var1}</code> and <code>"#{var1}</code> with the values of variables <code>var1</code> and <code>var1</code>. Is there a smart way to do this without iterating over the whole string and finding the pattern <code>#{}</code> and then replacing it?<br>
  I couldn't find a library that would do that.</p>