What is the VB.NET select case statement logic with case OR-ing?

后端 未结 5 995
一个人的身影
一个人的身影 2021-02-06 20:42

I\'m using an Or statement in my case expression.

Even though I have a value within this range, it didn\'t find a match. Why not?

Example Code:<

5条回答
  •  天涯浪人
    2021-02-06 21:12

    Use the comma operator to delimit case statements

    Select Case 2
        Case 0,1,2,3
            Console.WriteLine("hit")
     End Select
    

提交回复
热议问题