David said:
Regardless of what should be allowed, VB regards "" as a legitimate char
assignment
Only if strict checking is disabled.
No, actually a Char will not be compared to "". The Char will be
converted to a string, and the string will be compared to "".
So, if you assign an empty string to a Char and then compare it to an
empty string, the comparison will give a False result:
DIm c As Char = ""
If c = "" Then
' will not get here
End If
- and equivalent to "new Char()" or "Nothing" (note:
'Nothing' in VB means default value of the type and is not limited to
reference types).
Using New Char() actually creates slightly different code, but the same
result. It will create a temporary Char variable, initialise it, and
copy it to your Char variable.