& switch() Syntax: switch(<str>[,<pat1>,<res1>]...[,<dflt>]) The switch function compares <str> against <pat1>, <pat2>, etc (allowing * to match any number of characters and ? to match any 1 character), and returns the corresponding <resN> parameter for the first <patN> pattern that matches. If none match, then the default result <dflt> is returned. Example: > say switch(c,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "C" > say switch(f,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "E" > say switch(cab,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "A" > say switch(f,*a*,A,*b*,B,*c*,C,*d*,D) You say "" See Also: @switch, match(), ifelse(), case()