title: Replace keys in template string with object properties
body: <p>I have an object like this.</p>
  
  <pre><code>var obj = {Id:1,Rate:5,Price:200,Name:"History"}
  </code></pre>
  
  <p>And a template like this.</p>
  
  <pre><code>var templateString = '&lt;option id="{Id}"&gt;{Name}&lt;/option&gt;'
  </code></pre>
  
  <p>I want to replace the template values with object values. How can i do this. I am no expert of javascript regular expressions.</p>
  
  <p>The desired output</p>
  
  <pre><code>var optionString = '&lt;option id="1"&gt;History&lt;/option&gt;'
  </code></pre>
  
  <p><a href="http://jsfiddle.net/raheelshan/erms8Lk7/" rel="nofollow"><h2>Fiddle Sample</h2></a></p>