Is that a VB code or C#?

Ok, so the below code got me confused for a moment and I had to verify a couple of times if I am in the right language environment :).

int myNumber = 1;
string myString = myNumber as string;

 

My initial question is, what’s the as keyword doing in a C# code?  Is that a variable declaration like in VB?  As it turned out, it’s another operator in C# that performs like a cast operation but instead of raising an exception if the conversion is not possible, it returns null.  So there you go, next time you see as keyword in C#, you are not hallucinating :).