We use as
for normal casts. There is also as?
. One use of as?
is for a nullable
cast. If the object is not-null
, it is cast to our designated type. Otherwise, it
is cast a nullable form of the designated type.
You can learn more about this in:
Tags: