replacing characters in a string
<p>Why does this just not work out for me ?</p>

<pre><code>&lt;script type="text/javascript"&gt;
var gene="ATTAHATHHATTCGTA";
var i=0;
for (;i&lt;gene.lenth;i++)
{
   if(gene[i]=='H')
     gene[i]='G';
}
&lt;/script&gt;
</code></pre>

<p>I change it by use of replace as follows</p>

<pre><code>&lt;script type="text/javascript"&gt;
var gene="ATTAHATHHATTCGTA";
var i=0;
for (;i&lt;gene.lenth;)
{
   var pos=gene.replace("H","G");
   i+=pos;
}
&lt;/script&gt;
</code></pre>

<p>but I am still out of luck. Thank you for any help.</p>
