我从webservice获取数据,我正在解析为JSON字符串.在解析时我是这个例外:"org.json.JSONException:字符1834处的未终止字符串"
我的代码是,
String jsonstring=getJSONString(response);
JSONObject json = new JSONObject(jsonstring);
Run Code Online (Sandbox Code Playgroud)
字符串是,
[{"LotDescription":"David Weekley homes Traditional Collection in Baxter Village offers floor plans featuring innovative design and unsurpassed quality. This charming community combines work, play and living, all within the Village. In Baxter Village, you’ll enjoy: Parks, playgrounds"}]
Run Code Online (Sandbox Code Playgroud)
它正在解析直到单词"Village"并在解析"you"时提出异常,这似乎是一些HTML内容.
这是什么解决方案?
你需要添加角色\。
[{"LotDescription":\"David Weekley homes Traditional Collection in Baxter Village offers floor plans featuring innovative design and unsurpassed quality. This charming community combines work, play and living, all within the Village. In Baxter Village, you’ll enjoy: Parks, playgrounds\"}]
Run Code Online (Sandbox Code Playgroud)
这样就可以了。
| 归档时间: |
|
| 查看次数: |
22468 次 |
| 最近记录: |