H
Herfried K. Wagner [MVP]
Scott M. said:The VB 6.0 way are not methods, they are functions. The .NET way are
object methods. The VB.NET compiler does NOT optimize the VB 6.0
functions to work BETTER than the natvie .NET object methods.
Does this really matter? The JIT compiler could inline the type conversion
functions.
To answer your question, ToString would be my suggestion, rather than
CStr(). ToString is a method of the Object Type, and since all classes
inherit from Object, all objects have this method.
'ToString' and 'CStr' serve different purposes. 'ToString' won't work on
'Nothing' references, which is a downside /if/ a 'Nothing' reference should
be converted to an empty string. That's exactly where 'CStr' can be used.