是否存在可以替换if()参数的短代码,例如:
int x = 1; // x can be 1,2,3 etc. if(x==1 || x==3 || x==12) { //do something.. }
我不想重复x == 1,x == 3等,只是将数字与x进行比较.
c# variables wpf int compare
c# ×1
compare ×1
int ×1
variables ×1
wpf ×1