null-coalescing operator in X#?
Posted: Thu Apr 04, 2019 9:14 am
Two questions:
Is there in X# a null-coalescing operator as in C# the ??
?
Is in X#
the (only) syntax for the C# ternary conditional operator
or is there another syntax possible (i'm not looking for the if...then...else...endif construction ofcourse...)
Is there in X# a null-coalescing operator as in C# the ??
Code: Select all
return source ?? String.Empty;
Is in X#
Code: Select all
iif(source==String.Empty,"is empty","is not empty")
Code: Select all
source == String.Empty ? "is empty" : "is not empty"