易丰科技
标题:
C# Conditional Operator (?:) and Null-Coalescing Operator ??
[打印本页]
作者:
Calvin
时间:
2011-10-16 14:16
标题:
C# Conditional Operator (?:) and Null-Coalescing Operator ??
string fileName = tempFileName != null ?
tempFileName : "Untitled";
复制代码
string fileName = tempFileName ?? "Untitled";
复制代码
int? count = null;
int amount = count ?? default(int);
复制代码
欢迎光临 易丰科技 (http://forum.yftek.com/)
Powered by Discuz! X3