Switch method but using Strings
Hi all,
was wondering if there was a string version of the switch method where instead of requiring an int it asks for a string. I got a project which at the moment uses a lot o ifs and i wanted a better method instead. Any help?
The switch method where you have
switch (score)
{
case 0: AllGamesPlayed = AllGamesPlayed +1; break;
case 1: YLossPts = YLossPts +1; break;
case 2: YWinPts = YWinPts +1; break;
}
theres an example of a switch using an int number so depending on what score is equal will select the case is there a string version of this so i could have a switch which could select a case with a string name like yellow or green if so how?

