int num = 100;
char c = 'a';
c = someBigTask(c);
switch (c) {
case 'a':
num += 100;
case 'c':
num += 10;
case 'd':
case 'e':
num += 100;
}
I want to eliminate same code by 'when' expression in another condition like this switch-case code, but I couldn't find the solution..
I did like this for this problem:
var num = 0
when(c){
'a' -> num += 100
'a', 'c' -> num += 10
'a', 'c', 'd', 'e' -> num += 100
else -> 0
}
and I getted the result excuted only 'a' -> num += 100
..
Can I get the solution with only 'when' expression in this problem?