C# string.Replace not working
<p>I have a function that replaces string[index] with a character, if the character exists in another string(of the same length)</p>

<p>My function:</p>

<pre><code>foreach(char c in word)
{
    if (c == guessletter)
    {
        maskedWordTemp = maskedWord.Replace(maskedWord[i], c);
        a++;
    }

    i++;
}
</code></pre>

<p>If guessletter is c, then the whole word is replaced with c, instead of the index letter maskedWord is word but masked with ------</p>
