Check out example codes for "as c#". It will help you in understanding the concepts better.

Code Example 1

// taking a string variable 
string str1 = "GFG"; 

// taking an Object type variable 
// assigning var1 to it 
object obj1 = str1; 

// now try it to cast to a string 
string str2 = obj1 as string;

//here, 'as' is used to cast the object obj1 to a string,
//as the object already contained data of a string object

Learn ReactJs, React Native from