title: How to compare one value against multiple values - Swift
body: <p>Let's say that you have the code</p>
  
  <pre><code>if stringValue == "ab" || stringValue == "bc" || stringValue == "cd" {
      // do something
  }
  </code></pre>
  
  <p>Is there a way to shorten this condition or beautify it (preferably without using the switch statement)? I know that this code does NOT work:</p>
  
  <pre><code>if stringValue == ("ab" || "bc" || "cd") {
      // do something
  }
  </code></pre>
  
  <p>I've seen some complex solutions on other languages, but they seem language specific and not applicable to Swift. Any solutions would be appreciated.</p>