switch 문에 여러 조건을 추가 할 수 없습니다. switch 문을 사용하여이를 수행하는 방법? 여러 if 조건을 사용해야합니까?스위치 C에서 다중 조건
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;
}
좋은 옛 'if' –