我该如何缩短它?
string veryLongVariableName;
if (veryLongVariableName == "a" || veryLongVariableName == "b" || veryLongVariableName == "c"|| veryLongVariableName == "d"|| veryLongVariableName == "e"|| veryLongVariableName == "f")
可能会这样吗?
if (veryLongVariableName == ("a", "b", "c", "d", "e", "f"))
if (veryLongVariableName == ("a" || "b" || "c" || "d" || "e" || "f"))
您差一点就拥有了