Mark Chambers <no_spam@_nospam.comwrote:
Hi there,
In the expression A + B where A is a string and B isn't, I know that
"B.ToString()" will be called and the results concatenated. If B is null
however does the standard guarantee that "String.Empty" will be used
instead. Thanks.
Yup, the spec says:
<quote>
If an operand of string concatenation is null, an empty string is
substituted. Otherwise, any non-string argument is converted to its
string representation by invoking the virtual ToString method inherited
from type object. If ToString returns null, an empty string is
substituted.
</quote>
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too