如何从Android中的字符串中删除转义斜杠 [英] how to remove escape slash from string in android
本文介绍了如何从Android中的字符串中删除转义斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了所有可能的解决方案,但找不到任何答案.
I have tried all possible solution but couldn't find any answers.
我有以下字符串.
"{\"property_type\":[\"residential\"],\"status\":[\"active\"],\"category\":[\"sale\"],\"page_size\":8,\"cur_page\":1}"
这是我从json获得的响应.
This is response I am getting from json.
请帮助我解决这个问题.
Please help me with this concern.
推荐答案
如果您想从android中删除转义斜线,可以尝试使用此方法.
You may try this if you want to remove escape slash from android ....
String receivedString = "{\"property_type\":[\"residential\"],\"status\":[\"active\"],\"category\":[\"sale\"],\"page_size\":8,\"cur_page\":1}";
String changedString = receivedString.replaceAll("\"", "\"");
Log.d("your_tag", changedString);
输出将如下所示:
{"property_type":["residential"],"status":["active"],"category":["sale"],"page_size":8,"cur_page":1}
这篇关于如何从Android中的字符串中删除转义斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文