public static IsValidJson ( string possibleJson ) : bool | ||
possibleJson | string | |
return | bool |
public static bool IsValidJson(string possibleJson)
{
try
{
// ReSharper disable once AccessToStaticMemberViaDerivedType
JToken token = JContainer.Parse(possibleJson);
return true;
}
catch
{
return false;
}
}