One line if in VB .NET

Raúl Roa picture Raúl Roa · Apr 21, 2009 · Viewed 110.8k times · Source

Is it possible to do one line if statement in VB .NET? If so, how?

Answer

beach picture beach · Apr 21, 2009

Use IF().

It is a short-circuiting ternary operator.

Dim Result = IF(expression,<true return>,<false return>)

SEE ALSO: