title: String array not working with .equals
body: <p>I am making a hangman game in Swing and am working on the section that checks if the value entered by the user  was in the word. I have put each letter of the word into an array. However when I enter a letter I know is in the array it outputs that it was not a letter. Using <code>.contains</code> creates an error message.  </p>
  
  <p>Code relating to the problem below. </p>
  
  <pre><code>private void checkcorrect() {
      for (int i = 0; i &lt; word.length(); i++) {
          System.out.println(i);
          if(wordch[i].equals(inputString)) {
              System.out.println("Success");
              letter = true;
          }
      }
  
      if(letter==true) {
          System.out.println("Was a letter");
      }else {
          System.out.println("Not a letter");
      }
  }
  
  private class TextFieldListener implements ActionListener{  
      public void actionPerformed(ActionEvent evt){ 
          String inputString = userInput.getText();
          userInput.setText("");
          System.out.println(inputString );
          checkcorrect();
      }
  }
  </code></pre>