char replacement methods
<p>may i ask what is the alternative function for the replace() method in java? since the replace method will replace the old char to a new char but my code is like hangman which initially you have _ _ _ _ _ and when i use replace() instead of replacing a specific charAt() like charAt(2) = 'A', it will replace all the _ with A. any suggestions on what is the alternative for replacing a specific character? thank you</p>

<p>here is my code fragment.</p>

<pre><code>  guessLetter = txtguesswordS.getText().toString();

    char letter = guessLetter.charAt(0);

  int indx = word.indexOf(letter);

  public void convertUnderscore(String word){
        for(int x = 0;x&lt;word.length();x++){
             Uscore += "-";
         }

 public void replaceLetter(char letter, int indx){
         char oldLetter;
         oldLetter = Uscore.charAt(indx);
         update = Uscore.replace(oldLetter, letter);
     }
</code></pre>
