1
在C#中,我们有这样的有条件分配:vb.net:它是怎么回事?要么 ??条件在C#为VB.NET?
var test = 1;
var something = (test == 1)? "P":"C";
或者
var test = null;
var something = test ?? "";
是否有可能做到这一点在vb.net?
我正在使用c#编程,但在这个项目中,我在vb.net编程,我不记得是否有可能做到这一点。
一重复:http://stackoverflow.com/questions/576431/is-there-a-conditional-ternary-operator-in-vb-net – 2014-12-02 12:20:25
另一个重复:http:// stacko verflow.com/questions/6792729/vb-net-null-coalescing-operator – Mephy 2014-12-02 12:22:20
另一个问题是通过使用只有两个参数的“if”版本回答的 – 2014-12-02 12:22:25