我可以简化这个案例陈述吗?

2 c#

我有以下内容:

switch (id.Substring(2, 2))
{
    case "00": return("14");
    case "01": return("19");
    case "02": return("19");
    case "03": return("19");
    case "1F": return("19");
    case "04": return("17");
    case "05": return("18");

}
Run Code Online (Sandbox Code Playgroud)

对此不确定但有没有办法将"01","02","03"和"1F"合二为一?

Mar*_*ell 10

    switch (id.Substring(2, 2))
    {
        case "00": return("14");
        case "01":
        case "02":
        case "03":
        case "1F": return("19");
        case "04": return("17");
        case "05": return("18");
    }
Run Code Online (Sandbox Code Playgroud)

基本上,只要您不添加任何代码(因为不支持直通),您可以对多个测试值使用相同的结果路径.