相关疑难解决方法(0)

如何结合|| 运营商在条件声明中

代替

if (foo == "1" || foo == "5" || foo == "9" ... ) 
Run Code Online (Sandbox Code Playgroud)

我喜欢将它们组合成以下(不起作用):

if (foo == ("1" || "5" || "9" ... ))
Run Code Online (Sandbox Code Playgroud)

那可能吗?

.net c#

77
推荐指数
8
解决办法
2456
查看次数

标签 统计

.net ×1

c# ×1