What is the C# equivalent to Java's isInstance()?

diegogs picture diegogs · Nov 12, 2008 · Viewed 73.7k times · Source

I know of is and as for instanceof, but what about the reflective isInstance() method?

Answer

Ana Betts picture Ana Betts · Nov 12, 2008
bool result = (obj is MyClass); // Better than using 'as'