java字符串转json

针对不同jar包

一:

import org.json.JSONObject;

JSONObject jo = new JSONObject(new String(需要转换的字符串));

二:

import com.alibaba.fastjson.JSONObject;

JSONObject jo = JSONObject.parseObject(new String(需要转换的字符串));

你可能感兴趣的:(java字符串转json)