title: how to change an index in a StringBuilder based on what the user enters
body: <p>I want to change an index on a <code>StringBuilder</code> based on a string the user enters for example i made an array but i have to change it into a string so i used <code>StringBuilder</code> to do so. Now i created another string that will have the user input and then replace the index with what the user entered. Here is what i have:</p>
  
  <pre><code>    Arrays inventory = new Arrays();
      String[] words = inventory.getWords();
      String[] category = inventory.getCategory();
      String board = "";
      StringBuilder builder = new StringBuilder();
      for(String s : words) {
          builder.append(s+"\n");
      }
  </code></pre>
  
  <p>This is another part of the code. The part i want it to change the index but i get an error saying that the method <code>setCharAt</code> is undefined for the string type. i also tried other methods like <code>replace()</code> but get the same error. I have to use strings for this:</p>
  
  <pre><code> String word1 = builder.substring(0, 7);
       board.equals(word1);
       Scanner in = new Scanner(System.in);
       System.out.println("enter a letter to guess the word");
       String input = in.nextLine();
       char aChar = builder.charAt(0);
       if (input.equals(aChar)){
           board.setCharAt(0, input);
           System.out.println(board);
       }
  </code></pre>