Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The 'as' operator
Message
From
24/11/2003 12:47:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
The 'as' operator
Miscellaneous
Thread ID:
00852995
Message ID:
00852995
Views:
40
Hey!

what's the equivalent of C#'s "as" operator in VB.NET?

in C#, we can do safe casts as in:
human john = new Human();
man anyman = john as man;
if (anyman != null)
   // john is man, so go ahead
I know it is possible to use the "is" operator to check the type, but that's not optimized for performance. How's the optimized version for that in VB?

TIA
Claudio Lassala
Next
Reply
Map
View

Click here to load this message in the networking platform