Try this one, it will work in all the cases:
{\"text\" : \"I am \\\"litteraly\\\" hurting inside that this does not work!\"}
Sample code:
Using JSONObject
:
String str = "{\"text\" : \"I am \\\"litteraly\\\" hurting inside that this does not work!\"}";
try {
System.out.println(new JSONObject(str).getString("text"));
} catch (JSONException e) {
e.printStackTrace();
}
Using Gson
:
class Text implements Serializable{
private String text;
...
}
Gson gson = new Gson();
String str = "{\"text\" : \"I am \\\"litteraly\\\" hurting inside that this does not work!\"}";
System.out.println(gson.fromJson(str, Text.class).text);
Firefox Firebug plugin snapshot:
String str = "{\"text\" : \"I am \\\"litteraly\\\" hurting inside that this does not work!\"}";
try {
System.out.println(new JSONObject(str).getString("text"));
} catch (JSONException e) {
e.printStackTrace();
}