URL: http://stackoverflow.com/questions/501194/is-string-in-array
メソッド拡張
public static bool IsIn<T>(this T source, params T[] values) { return values.Contains(source); }
こう使える
string myStr = "str3"; bool found = myStr.IsIn("str1", "str2", "str3", "str4"); string myStr = "str3"; bool found = myStr.IsIn("str1", "str2", "str3", "str4");