Hi,
I am trying to use a switch statements for strings but it is not working is there any other method I could use ?? . ( I am trying to avoid using lots of if, else statements )
Thank you in Advance
Craig
Hi,
I am trying to use a switch statements for strings but it is not working is there any other method I could use ?? . ( I am trying to avoid using lots of if, else statements )
Thank you in Advance
Craig
Switch statements don't work with strings.
typecast the string to long? this is probably very ugly but could work
You would have to iterate through the whole character array and cast it to long, add up the values or something similar and then compare.
In short, yes, very ugly.