String 转 Json 记录"["abc","bcd"]" json 解析
废话不多说,直接给出json字符串数组,转list的解析方式:
import org.json.JSONArray; public class JsonTest { public static void main(String[] args) { String aString = "[\"abc",\"bcd\"]"; System.out.println(aString); //["adc","bcd"] JSONArray obj = new JSONArray(aString); for(int i = 0;i<obj.length();i++) { String jsb = obj.get(i).toString(); System.out.println(jsb); } } }