I have a question regarding casting that usually we do and the "as" keyword in C#.
E.g. in my code I use the following:
int counter = (int)strReturnValue;
Or I can also use the following:
int counter = strReturnValue as int;
Is there any difference between the above lines of code? As per my understanding if we use "as" keyword, it may not throw exception if the value in strReturnValue variable cannot be casted to int.
Please correct me if I am wrong.
View Complete Post