我正在阅读这个json
{"website": {"url": "http://www.google.com"}}
我将字符串存储在类似的json对象中
//I make a network call to get the string
JSONObject obj = new JSONObject(website_string);
当我去掉正斜杠时,我没有问题。如何保持前斜线?
以下是实现这一目标的方法:
string urlString = "http:'/'/mywebsite.com";
现在您可以从json中获得结果,并使用进行处理
string url = urlString .replace(''', '');