Using as : As : Operator C# Examples


C# Examples » Operator » As »

 

Using as





You can use the as operator to cast without raising an exception if the cast fails.
The general form:




    
expr  as  type
    
   
  
   


expr is the expression being cast to type.
On succeed, a reference to type is returned.
Otherwise, a null reference is returned.




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» As