Dev2.StringExtension.IsJSON C# (CSharp) Method

IsJSON() public static method

public static IsJSON ( this payload ) : bool
payload this
return bool
        public static bool IsJSON(this string payload)
        {
            try
            {
                JsonConvert.DeserializeObject(payload);
                return true;
            }
            catch
            {
                return false;
            }
        }