java - Re-format unreadable JSON to readable JSON on android -


how can re-format such response. need escape \t , \n. have tried reformat replacing "" won't work. valid json response api. have used jsontokener none worked.

"\n \t{\n\t\t\t \"id\": \"567ditr\",\n\t\t\t\t\"url\": \"http://test.com/visa/wallet/debit-auth/code?autcode=‌​yueyuw77676&ref_id=0‌​909343ssdsds&lang=en‌​g\", \n\t\t\t\t\"code\": \"oi08989pk3mkpitxn\",\n\t\t\t\t\"created_at\": \"mon, 02 feb 2015 14:07:08 utc\"\n\t\t\t}\n "

i need this:

{ "id":"23", "dept":"ict" }

jsonstr = jsonstr.replace("\\\\n", jsonstr);         jsonstr = jsonstr.replace("\\\\t", jsonstr);          jsonstr = jsonstr.replaceall("\\\\", ""); 

try this


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -