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

相關文章
相關標籤/搜索