Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# check if object can be cast to type

var myObject = something as String;

if (myObject != null)
{
  // successfully cast
}
else
{
  // cast failed
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #object #cast #type
ADD COMMENT
Topic
Name
3+8 =