title: append characters in arraylist in a specific position
body: <pre><code>public void reveal(char c) {
  
      for(int i = 0; i &lt; sizeReset; i++) {
          if(wordCompare.charAt(i) == c)  revealed.set(i);
          if(revealed.cardinality() == 0) {
              eo.add(String.valueOf('*'));
          }
          else {
              if(revealed.get(i) == true) {
                  eo.add(String.valueOf(wordCompare.charAt(i)));
              }
              else {
                  eo.add(String.valueOf('*'));
              }
          }
  
  }
      System.out.println(eo.toString());
      jTextPane1.setText(eo.toString().replace("[", "").replace("]", "").replace(",", "")); 
  }
  </code></pre>
  
  <p>Note:</p>
  
  <p>String wordCompare - contains the word to guess.</p>
  
  <p>char c - is the letter being entered by the user</p>
  
  <p>revealed - is a declared as a BitSet</p>
  
  <p>int sizeReset - is the size of the word to guess</p>
  
  <p>ASSUME THAT ArrayList eo = new ArrayList(); is declared outside the method. (global)</p>
  
  <p>=============================================</p>
  
  <p>This is what I have so far. Let's say I'll be guessing "banana". the entered letter by the user will be shown, and the rest will be marked as "*".</p>
  
  <p>===========================================</p>
  
  <p>PROBLEM: It appends the entire values including the "<em>" to the end of the stored values in the arrayList and not in the specific position that I want them to be.(also the "</em>" should not be included when it appends. only the letters that the user entered). *THE LOGIC OF THE HANGMAN GAME.</p>
  
  <p>SAMPLE:</p>
  
  <p>first letter entered: "a"</p>
  
  <p>OUTPUT:</p>
  
  <p>_a_a_a</p>
  
  <p>second letter entered: "n"</p>
  
  <p>OUTPUT:</p>
  
  <p>_ _n_n_</p>
  
  <p>(which is wrong)</p>
  
  <p>The correct OUTPUT should be:</p>
  
  <p>_anana</p>
  
  <p>===============================================</p>
  
  <p>I'm new to String manipulation and I'm having trouble with this part. I've read something about StringBuilder but I haven't figured it out yet. It would be really great if you can help me. Thanks in advance. :)</p>