In VB.Net, I would write my Select Case as
How do I do that in C#Code:Dim sid As Integer = 0 sid = 41 Select Case sid Case 33 To 60 End Select
I tried using this convertor
It gave me
which obviously is not what I want...Code:switch (sid) { case 33: // TODO: to 60 break; }
I was referring to this link
So in c# do I have to write it as
If yes, then what if there are 100 values to check (1 To 100)? Do I have to write Case 100 times? Or is there a better way to write it?Code:switch (sid) { case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: case 60: break; }




Reply With Quote