📜  switch case c# range - C# 代码示例

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

代码示例2
switch( number > 9 ? "High" :
        number > 5 ? "Mid" :
        number > 1 ? "Low" : "Floor")
        {
              case "High":
                    do the thing;
                    break;
               case "Mid":
                    do the other thing;
                    break;
               case "Low":
                    do something else;
                    break;
               case "Floor":
                    do whatever;
                    break;
         }