java string.contains in switch 语句
2022-09-02 09:04:48
如何将以下代码转换为 switch 语句?
String x = "user input";
if (x.contains("A")) {
//condition A;
} else if (x.contains("B")) {
//condition B;
} else if(x.contains("C")) {
//condition C;
} else {
//condition D;
}