Putting curly braces in a sentences for specific words according to their start and end indexes
<p>I need to put curly braces in a sentence according to the indexes. Suppose my input sentence is: <code>"I am a girl and I live in Nepal."</code> and I need to put curly braces according to</p>

<pre><code>[12, 15], [2, 4], [23, 25]
</code></pre>

<p>These indexes are corresponding to the words <code>"am"</code>, <code>"and"</code> and <code>"in"</code> respectively.
The required output should be: </p>

<pre><code>"I {am} a girl {and} I live {in} Nepal."  
</code></pre>

<p>I have tried using <code>substring</code> but after it replaces first word, it then shifts the characters by two indexes and that is the problem I am having. </p>

<p>Can anyone provide me solution to get the required output?    </p>
