Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The 'as' operator
Message
De
24/11/2003 12:47:42
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
The 'as' operator
Divers
Thread ID:
00852995
Message ID:
00852995
Vues:
41
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform