title: Compare one String with multiple values in one expression
body: <p>I have one String variable, <code>str</code> with possible values, <code>val1</code>, <code>val2</code> and <code>val3</code>.</p>
  <p>I want to compare (with equal case) <code>str</code> to all of these values using an if statement, for example:</p>
  <pre><code>if(&quot;val1&quot;.equalsIgnoreCase(str)||&quot;val2&quot;.equalsIgnoreCase(str)||&quot;val3&quot;.equalsIgnoreCase(str))
  {
        //remaining code
  }
  </code></pre>
  <p>Is there a way to avoid using multiple OR (||) operators and compare values in one expression? For example, like this:</p>
  <pre><code> if((&quot;val1&quot; OR &quot;val2&quot; OR &quot;val3&quot;).equalsIgnoreCase(str)   //this is only an idea.
  </code></pre>