title: in operator in C#
body: <p>I think there was an <em>in</em> operator in Commodore 128 Basic.<br>
  Is there an in operator in c# too?  </p>
  
  <p>I mean is there an operator of kind  </p>
  
  <pre><code>if(aString in ["a", "b", "c"])  
    Console.Out.WriteLine("aString is 'a', 'b' or 'c'");
  </code></pre>
  
  <p>Edit1: Currently I need it to decide if an enum value is in a range of some enum values.  </p>
  
  <p>Edit2: Thank you all for the Contains() solutions. I will use it in the future. But currently I have a need for enum values. Can I replace the following statement with Contains() or other methods?  </p>
  
  <pre><code>public enum MyEnum { A, B, C }
  
  class MyEnumHelper
  {
    void IsSpecialSet(MyEnum e)
    {
      return e in [MyEnum.A, MyEnum.C]
    }
  }
  </code></pre>
  
  <p>Edit3: Sorry it was not Basic. I just googled a while and found Turbo Pascal as a candidate where I could saw it. See <a href="http://en.wikipedia.org/wiki/Pascal_%28programming_language%29#Set_types" rel="nofollow" title="Set Types in Turbo Pascal">http://en.wikipedia.org/wiki/Pascal_%28programming_language%29#Set_types</a></p>
  
  <p>Edit4: <strong>Best answers up to now (end of 15 Feb 2012):</strong></p>
  
  <ul>
  <li>For lists and arrays: accepted answer and all other answers with
  <em>Contains()</em> solutions  </li>
  <li>For Enums: TheKaneda's answer with good list of pros/cons for
  different extension methods</li>
  </ul>