title: Checking if String x equals any of the Strings from String[]
body: <p>I am trying to set a boolean true if a user-entered string equals any of the strings from a string array.</p>
  
  <p>I have improvised and came up with this</p>
  
  <pre><code>String[] cancelWords = {"cancel", "nevermind", "scratch that"};
  boolean valueEqualsCancel = true;
  for(String cancelWord : cancelWords) {
    if(!valueEqualsCancel) break;
    valueEqualsCancel =  valueEqualsCancel &amp;&amp; value.equals(cancelWord);
  }
  </code></pre>
  
  <p>But <code>valueEqualsCancel</code> is never true. </p>
  
  <p>Any tips?</p>