C Sharp Programming/Keywords/is

The keyword compares an object to a type, and if they're the same or of the same "kind" (the object inherits the type), returns. The keyword is therefore used to check for type compatibility, usually before casting (converting) a source type to a destination type in order to ensure that won't cause a type-cast exception to be thrown. Using on a  variable always returns.

This code snippet shows a sample usage:

/Keywords