Casts an object of one class to another class. Using this function is safer than a plain cast, as it also statically ensures that the variable being cast from is a class or an interface.
type to cast to (must be a class)
type to cast from (must be a class or interface)
object to be cast to type To
input parameter cast to type To. The returned object may be null if the From cannot be downcast to To
See Implementation
Casts an object of one class to another class. Using this function is safer than a plain cast, as it also statically ensures that the variable being cast from is a class or an interface.