C# is Operator

C# Code Snippets is operator


In this code snippet, we will learn how to use the is operator in C#.

The is operator is very similar to the as operator. They can both be used to check if an object is of a certain type. Additionally as can be used to perform type casting.

If the object matches the specified data type true gets returned else false will be returned.

Let’s have a look at the code below to see how to use the is operator.


[amp-gist id=”7e4b372ff19af388b8768bd5d6939eef”]

Resulting output:


Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.
The following GDPR rules must be read and accepted:
This form collects your name, email and content so that we can keep track of the comments placed on the website. For more info check our privacy policy where you will get more info on where, how and why we store your data.

Advertisment ad adsense adlogger