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

public static boolean isJson(String content) {
        try {
            JSONObject.fromObject(content);
            return true;
        } catch (Exception e) {
            return false;
        }
    }

转载自:https://www.cnblogs.com/f-l-y/p/9155711.html

猜你喜欢

转载自blog.csdn.net/keep12moving/article/details/84937982