无法在 switch 语句中添加多个条件。如何使用 switch 语句来做到这一点?我必须使用多个 if 条件吗?
string oldValue = ".....long string1....";
string newValue = ".....long string2....";
switch (oldValue.Length && newValue.Length)
{
case <500 && <500:
//insert as is
break;
case >500 && <500:
//split oldValue into array of strings and insert each
//insert newValue as is
break;
case <500 && >500:
//insert oldValue As is
//split newValue into array of strings and insert each
break;
case >500 && >500:
//split oldValue into array of strings and insert each
//split newValue into array of strings and insert each
break;
default:
break;
}