|
For simple cases, VB's Select construct can be
converted to the C# switch construct. However, if any of the
Case statements include range or non-constant expressions, then the
equivalent is an if/else block.
For example, the following VB code:
Select Case x
Case 1 To 3
...
Case Is < 10, Is > 20, Is = 15
...
End Select
Has the following C# equivalent:
if (x >= 1 && x <= 3)
...
else if ((x < 10) || (x > 20) || (x == 15))
...
If you need to convert between VB.NET and C#
and you are depending on the results being reliable and accurate,
then you will want to have
Instant
C#,
the best VB.NET to C# converter, or
Instant
VB,
the best C# to VB.NET converter, at your fingertips.
|