I use this extension method all the time
public static bool IsIn(this string source, params string[] parms) { return parms.Contains(source); }
And use it as follows:
if (!mode.IsIn("A", "B", "C", "D", "E", "F", "G")) { continue; }
The next step, if you use it a lot,
public static bool IsNotIn(this string source, params string[] parms) { return !IsIn(source, params); }
and you get a little more readable
if (mode.IsNotIn("A", "B", "C", "D", "E", "F", "G")) { continue; }
source share