// using System.Linq; public static bool In<T>(T val, params T[] args) => args.Contains(val); // Example usage: var x = "A"; _ = In(x, "A", "B", "C") ? "valid" : "invalid";
308000cookie-checkC# Short Contains function
// using System.Linq; public static bool In<T>(T val, params T[] args) => args.Contains(val); // Example usage: var x = "A"; _ = In(x, "A", "B", "C") ? "valid" : "invalid";