相关疑难解决方法(0)

使用三元运算符而不是IF那么有什么意义呢?

为什么让事情变得更复杂?为什么这样做:

txtNumerator.Text = 
     txtNumerator.Text == "" ? "0" : txtNumerator.Text;
Run Code Online (Sandbox Code Playgroud)

而不是这个:

if txtNumerator.Text="" {txtNumerator.Text="0";}
Run Code Online (Sandbox Code Playgroud)

c#

8
推荐指数
2
解决办法
1392
查看次数

标签 统计

c# ×1