How to un escape strings extracted from json objects in java? -


in java program download json object, when string it, "what\'s" example, though in php put in "what's". has slashes escape quotes , possibly other characters. there java function can use unescape , turn "what's"?

jsonobject object = new jsonobject(response); firstname = object.getstring("firstname"); 

if mean remove slashes, use string.replace() method replace \ empty substring.

i think this

string s = yourstring.replace("\\","");   

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -