是。您可以按照以下方式进行操作:
var testVal = "hello"var result = 0switch testVal {case "one", "two": result = 1default: result = 3}另外,您可以使用
fallthrough关键字:
var testVal = "hello"var result = 0switch testVal {case "one": fallthroughcase "two": result = 1default: result = 3}


