title: Replacing contents inside curly braces (for e.g. {1}) with something else
body: <p>I have a string as follows</p>
  
  <pre><code>Hey {1}, you are {2}.
  </code></pre>
  
  <p>Here <code>1</code> and <code>2</code> are key whose value will be added dynamically.</p>
  
  <p>Now I need to replace <code>{1}</code> with the value that <code>1</code> represents and then I need to replace <code>{2}</code> with the value that <code>2</code> represents in the sentence above.</p>
  
  <p>How do I do it?</p>
  
  <p>I know what split function of a string does and I know very well that with that function I can do what I want but I am looking for something better.</p>
  
  <p><strong>Note:</strong> I don't know what these keys are in advance. I need to retrieve the keys as well. And then according to the keys I need to replace the values in the string.</p>