java判断string字符串是否是json格式

环境:使用阿里Fastjsonjson

public static boolean isJSON(String context){
try{
JSONObject jsonObject=JSONObect.parseObject(context);
return true;
}catch(Excepiton e){
e.printStackTrace();
return false;
}ide

}it

相关文章
相关标签/搜索