Thanks for responding Sidney.  I think if I set a var prior to the switch, it 
might not work because there are so many strings going into the switch.  I'm 
trying to optimize this that would apply to only some of all the cases:

switch(str){
        case ("W1") :
        case ("W2") :
        case ("W3") :
                break;
        case ("M1") :
        case ("M2") :
        case ("M3") :
                break;
        case ("K1") :
        case ("K2") :
        case ("K3") :
                break;
        }
}

...into something shorter like this:
switch(str){ 
        case(/(W|M|K)\d/i):
                break;
}



> I think its better practice to define that regex in a variable and  
switch on that variable.


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to