Difference between DirectCast() and CType() in VB.Net

Posted by Chapso on Stack Overflow See other posts from Stack Overflow or by Chapso
Published on 2010-06-16T19:27:53Z Indexed on 2010/06/16 19:42 UTC
Read the original article Hit count: 226

Filed under:
|
|

I am an experienced C/C++/C# programmer who has just gotten into VB.NET. I generally use CType (and CInt, CBool, CStr) for casts because it is less characters and was the first way of casting which I was exposed to, but I am aware of DirectCast and TryCast as well.

Simply, are there any differences (effect of cast, performance, etc.) between DirectCast and CType? I understand the idea of TryCast.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about ctype