Basically something along the lines of:
switch (string.contains(x))
{
case(x = "asdf"):
break;
case(x = "jkl"):
break;
case(x = "qwerty"):
break;
}
edit: Sorry guys, what I’d ideally like is to have the switch statement check the string for several different values, and depending on which of the values it finds inside the string, execute the appropriate code.
You can’t do this unfortunately, however you can apply “functional pattern matching”. Read up here on how to do it:
http://codebetter.com/matthewpodwysocki/2008/09/16/functional-c-pattern-matching/