小编Tag*_*gon的帖子

比较几个数字到变量int作为IF参数

是否存在可以替换if()参数的短代码,例如:

int x = 1; // x can be 1,2,3 etc.
if(x==1 || x==3 || x==12)
{
     //do something..
}
Run Code Online (Sandbox Code Playgroud)

我不想重复x == 1,x == 3等,只是将数字与x进行比较.

c# variables wpf int compare

2
推荐指数
1
解决办法
112
查看次数

标签 统计

c# ×1

compare ×1

int ×1

variables ×1

wpf ×1