从JSON提要中提取数据

时间:2017-03-02 20:11:34

标签: android json

有人可以告诉我如何从以下JSON获取titlehref属性吗?

{
 "funding": [ {
                "FIELD1": "1",
                "FIELD2": "01/12/2016",
                "FIELD3": "<a title=\"SidQam\" href=\"http://www.sidqam.com/\">SidQam</a>",
                "FIELD4": "Technology",
                "FIELD5": "Healthcare Software System",
                "FIELD6": "Noida",
                "FIELD7": "SQue Capital, Grace Capital Ventures, Soham Vencaps",
                "FIELD8": "Private Equity",
                "FIELD9": "1,200,000"
              }
            ]
}

1 个答案:

答案 0 :(得分:0)

JSONObject jsonObject = new JSONObject(jsonString);
JSONArray jsonArray = jsonObject.getJSONArray("funding");
String link = jsonArray.getString("FIELD3");
String href = link.substring(link.indexOf("http://"), link.indexOf("\">"));
//href must be clear link