How to use equivalent C/C++ short-form if (conditional ternary operator) in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim a As Integer = 12, b As Integer = 20

        Dim c As String = If(a > b, a, b)

        Console.WriteLine(c)

    End Sub

End Module

' run:
' 
' 20

 



answered May 27, 2017 by avibootz

Related questions

2 answers 314 views
2 answers 320 views
1 answer 222 views
2 answers 292 views
...