parse json with forward slash

How should I parse this json?


I try


But have got an error:

at org.json.JSON.typeMismatch

Any ideas? Thanks.


ArrayList<Gate> gates = new ArrayList<Gate>();
JSONArray jGates = object.getJSONArray("gates_info");
int gatesLength = jGates.length();
for (int i=0; i<gatesLength; i++) {
    Gate gate = new Gate();
    JSONObject jGate = jGates.getJSONObject(i);

Part of response:



Try to escape forward slash, i.e. write \\/. The back slash is written twice to escape itself, i.e. to make interpreter to treat it as a "real" back slash.

I have not tried this myself with JSON but typically such problems are solved using this kind of solutions.

Here I had this problem (it nothing to do with escape characters though. You just need to know how to use Json. You need to use the addProperty function: Here is an example you should be able to copy this and get it.

JsonObject temp = new JsonObject();

Need Your Help

How to extract functions call graph from a visual basic file?

.net reverse-engineering legacy-code

I'm currently facing a large piece of legacy code which I have to understand and rewrite to make it more maintainable.