Hi,
I've just tried the following, the idea being to concatenate the two strings, substituting an empty string for nulls.
string a="Hello";
string b=" World";
-- Debug (amusing that ? is print, doesn't exactly help readability...)
? a ?? "" + b ?? ""
-> "Hello"
Correct is:
? (a??"")+(b??"")
"Hello World"
I was kind of expecting "Hello World", or just "World" if a is null. Obviously this is todo with operator precedence and can be overcome by brackets, is there anywhere that documents the order of precedence for this new operator.
(Realising that I should probably be using stringbuilder or String.Concat)
Thanks.