private static readonly string[] trueValues = {"true","1", "y", "j", "ja", "yes"}; // add your language yes value here public static bool StringToBool(string val) => trueValues.Contains(val?.Trim(), StringComparer.OrdinalIgnoreCase);
520000cookie-checkC# parse string to boolean (false by default)