Answers for "c# check if object can be cast to type"

C#
0

c# check if object can be cast to type

var myObject = something as String;

if (myObject != null)
{
  // successfully cast
}
else
{
  // cast failed
}
Posted by: Guest on September-30-2021

Code answers related to "c# check if object can be cast to type"

C# Answers by Framework

Browse Popular Code Answers by Language