Very beginner question..
What's difference between cstr vs .ToString vs Ctype for converting to
String?
You missed the other option, which is DirectCast.
This isn't a simple question, because which to choose often depends on
what kind of object you want to convert and where you got that object.
..ToString will call the .ToString() function on a particular instance.
In practice, this means that it will throw an exception if the object in
question is Nothing. However, you can implement .ToString() in your own
classes to get a useful string representation of your object, whereas
CType/CStr only work with built-in classes and interfaces.
CStr and CType(<expression>, String) are exactly equivalent (I'm not
sure where the other poster got the idea that CStr is faster). But they
aren't really functions, they're compiler directives that will emit very
different code depending on the declaration of <expression>. In most
cases, these directives call a bunch of internal VB code that tries to
get a reasonable string out of <expression>.
DirectCast(<expression>, String) assumes that the expression in
question really is a string and just casts it. It's the fastest of all
these options, but will throw an exception if <expression> is anything
other than a string.
Which to choose depends on what you want to do.