Skip to main content
Break with each case.
Source Link
syb0rg
  • 21.8k
  • 10
  • 112
  • 191

" wondering what any of you ... would do to simplify/shorten my code..."

How about you use Switch statements rather than those cumbersome cascade of if/else statements? That should make it cleaner and more readable.

Something like

switch(input) {  
    case 'X' :   
         break;  
    case 'Y' : 
         break;  
    case 'Z' : 
         break;
    default : 
         break;
}  

" wondering what any of you ... would do to simplify/shorten my code..."

How about you use Switch statements rather than those cumbersome cascade of if/else statements? That should make it cleaner and more readable.

Something like

switch(input) {  
    case 'X' :   
    break;  
    case 'Y' :   
    case 'Z' : 
    default : 
}  

" wondering what any of you ... would do to simplify/shorten my code..."

How about you use Switch statements rather than those cumbersome cascade of if/else statements? That should make it cleaner and more readable.

Something like

switch(input) {  
    case 'X' :   
         break;  
    case 'Y' : 
         break;  
    case 'Z' : 
         break;
    default : 
         break;
}  
Source Link

" wondering what any of you ... would do to simplify/shorten my code..."

How about you use Switch statements rather than those cumbersome cascade of if/else statements? That should make it cleaner and more readable.

Something like

switch(input) {  
    case 'X' :   
    break;  
    case 'Y' :   
    case 'Z' : 
    default : 
}