Deane Deane - 1 year ago 82
C# Question

What's the opposite of "is"?

if(myVariable is SomeType)

Out of nothing but curiosity, what's the opposite of that? I want to do something like:

if(!myVariable is SomeType)
if(myVariable is not SomeType)

Neither compile.

Given that "is" is a non-searchable word in most engines, this has been a hard one to find an answer to.


C# : ‘is’ keyword and checking for Not

Answer Source


if (!(myVariable is SomeType))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download