[Solved] Working on a C# hangman game, cant figure out how to detect multiple letters [closed]


as a simple fix here is the code

if (j.Equals(leguess))// If the character = the letter guess
{
    int index = word.IndexOf(j);// Get the index of j
    while (index > -1)
    {
        guess = guess.Remove(index, 1).Insert(index, j.ToString());
        index = word.IndexOf(j, index + 1);
    }
}

I have inserted a while loop to replace all the occurrence in the guessed word

2

solved Working on a C# hangman game, cant figure out how to detect multiple letters [closed]