Equivalent C# statement

Hi,

Could any one tell me what would be the C# equivalent for the following Delphi/Pascal statement:

< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

IF ((a in [0,1,2]) or (b in [5..6])) THEN

BEGIN

END;



Answer this question

Equivalent C# statement

  • chrisortman

    Sad
    Damn... but thanx for your reply.

  • rfairlie

    C# does not support sets.  The only way that you could write the code is:
    if(a==0 || a == 1 || a == 2) || (b >= 5 and b <=6)
    {
    }

  • Scott Coolness

    When VS2005 comes out, it still won't have proper sets - BUT Peter Golde, (formerly a Lead Designer for the C# language) has designed a proper library of generic collections for it - and it includes a Set.

    See http://www.wintellect.com/powercollections/
    and the MSDN article: http://msdn.microsoft.com/msdnmag/issues/03/09/NET/
    for details.

  • Equivalent C# statement