📜  c#代码示例中的多案例

📅  最后修改于: 2022-03-11 14:49:19.129000             🧑  作者: Mango

代码示例1
switch (value)
{
   case var s when new[] { 1,2,3 }.Contains(s):
      // Do something
      break;
   case var s when new[] { 4,5,6 }.Contains(s):
      // Do something
      break;
   default:
      // Do the default
      break;
}