I just saw a weird result while I tried to concatenate two null strings: it returns an empty one! I can not imagine if it have some utility or why this occurs.
Example:
string sns = null;
sns = sns + sns;
// It results in a String.Empty
string snss = null;
snss = String.Concat(snss, snss);
// It results in a String.Empty too!
Can someone tell me why it returns a String.Empty instead of null?
+operator is a shorthand for theString.Concatmethod. If the arguments passed werenullthen it turns them into an empty string.