标签: vb.net ternary
在C#中,我可以这样做:
string outcome = (success?"succeeded":"failed")
但是在VB.NET中这种语法是唯一的等效操作吗?:
If (success) Then outcome = "succeeded" Else outcome = "failed" End If
答案 0 :(得分:2)
outcome = If(success,"succeeded","failed")