是否可以在VB .NET中执行一行if语句?如果是,如何?
使用IF()。
原文链接:https://www.f2er.com/vb/256440.html它是一个短路三元运算符。
Dim Result = IF(expression,<true return>,<false return>)
也可以看看:
> IIF becomes If,and a true ternary operator
> Is there a conditional ternary
operator in VB.NET?
> Orcas introduces the IF operator – a
new and improved IIF
> The Ternary Operator in VB.NET