How to substitute a query parameter in a string url
<p>Hello I have a url string like</p>

<pre><code>http://example.com/foo/?bar=15&amp;oof=myp
</code></pre>

<p>Now lets say that I want to change the int value in the bar parameter to 16, in order to have</p>

<pre><code>http://example.com/foo/?bar=16&amp;oof=myp
</code></pre>

<p>How can I do this? Considering that the number after the = might be of 1, 2 or ever 3 characters. Thank you</p>