Interview question: What is the purpose of “as” operator in C#?
“as” operator casts without raising an exception if the cast fails. Example: Object message = new StringReader (“desibanjara”); StringReader newMessage = message as StringReader; [amazon_link asins=’B019MQLUZG,B079R1JS6K,B079R17XY2,B019MQONW8,B076H5S8S6,B077L4X3PN,B07B6DM75J,B01N3BN5E8,B07B4RZNG2|B00UNEHS44,B01CQOL3F8,B00T7YNWH8,B00T7YOXQC,B01N6BBAK9,B01HE5NDHA,B00SX8GSGG,B01AWLBCIK,B01N0AKAYE’ template=’ProductGrid’ store=’desibanjara22-21|desibanjaraco-21′ marketplace=’IN|UK’ link_id=’287ddac1-9493-11e8-a97d-331c2e92ac11′]