5 Answers
New Answer5 Answers
New AnswerSwitch also works for characters, and strings are character arrays. There's probably a way to make things work, but it will depend on the case of your program and the strings you want to evaluate.
Maybe you can try marking each string with a unique number, and then check for the number using switch. That number may be : 0) Sum of All ASCII Codes of the characters in the string. 1) Sum of First Char's ASCII Code + Length of the string. etc,etc...
@Hatsy Rei Yes but characters are just numbers. It wouldnt make sense to go through the trouble instead of just using a simple if statement
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message