标签: c# switch-statement expression
需要了解,如何使用
switch( expression ){ case int val when val < 5: //do something case int val when val >= 5 && val < 10: //do something default: //do something }
例如,如果x <= 7 ...