Operators
Difference between 'as' and 'is' operator in C# ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jan 9, 2013, 12:47 AM EST
The 'As' operator is similar to a cast, but returns null instead of an exception if it fails.
The 'Is' operator is used to check if one object is compatible with a certain type. It's usually used in If statements.
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 9, 2013, 1:40 AM EST
http://msdn.microsoft.com/en-us/library/cscsdfbt%28v=vs.71%29.aspx
http://www.c-sharpcorner.com/uploadfile/mahesh/as-operator-in-C-Sharp/
http://msdn.microsoft.com/en-us/library/scekt9xw%28v=vs.71%29.aspx
http://www.c-sharpcorner.com/uploadfile/mahesh/is-operator-in-C-Sharp/
Thanks