是否可以在VB .NET中执行一行if语句?如果是,如何?
使用IF()。
它是一个短路三元运算符。
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