title: How to replace named parameter in a string
body: <p>I am working on a project built on <code>Java</code>.
  I have a use case where I have multiple templates of <code>strings</code> that need to be formatted by replacing keywords with their values.</p>
  <p>Since the position of parameter and name of the parameter is not always known and will change over time I want to write a function that takes a string and replace keywords (named parameter) with their values using the map.</p>
  <p>For e.g.</p>
  <pre><code>Hi my name is %name
  </code></pre>
  <p>And if I have map = {&quot;name&quot;:&quot;user1&quot;}</p>
  <p>Then my function should replace the name with user1.</p>
  <p>I tried to find if there is already an existing method or library in java but I couldn't find any.</p>