Chain ?? operator
19/01/2010 Leave a comment
You can chain more than one nullable variable and if all null it return string.Empty
string value = valx ?? valy?? valz ?? string.Empty;
Nice isnt it ?
All my posts are provided "AS IS" with no warranties, and confer no rights.
19/01/2010 Leave a comment
You can chain more than one nullable variable and if all null it return string.Empty
string value = valx ?? valy?? valz ?? string.Empty;
Nice isnt it ?
Filed under C# Tagged with ?? operator
About bpostaci
Escalation Engineer in Microsoft.