Trying to replace a substring of a string with another substring
<p>I'm trying to take this string</p>

<pre><code>where lowercase(pdd.last_name) like 'albert%' 
</code></pre>

<p>and replace "pdd" with "p" using this function</p>

<pre><code>sb.replace(queryAdd.indexOf("pdd"), (queryAdd.indexOf("pdd") + 3), "p");
</code></pre>

<p>where sb is a StringBuffer, but it doesn't work and here's what it actually returns </p>

<pre><code>where lowercase(pdpast_name) like 'albert%' 
</code></pre>

<p>Why does this not replace "pdd" with "p"?</p>
