isnt as a c# keyword

Posted by Mikael on Stack Overflow See other posts from Stack Overflow or by Mikael
Published on 2010-04-27T14:52:37Z Indexed on 2010/04/27 14:53 UTC
Read the original article Hit count: 362

Filed under:

To check if an object is of a certain class one can write:

if (item is Class)

why isn't the opposite possible?

if (item isnt Class)

instead one would write

if (!(item is Class)

which isn't as easy to read as if "isnt" was a keyword just as "is" is.

Is there something that makes it so that only "is" should be available or has "isnt" just been forgotten about?

© Stack Overflow or respective owner

Related posts about c#