在Android

时间:2019-11-12 10:01:54

标签: android json string android-volley json-arrayagg

我正在使用截击请求,作为回应,我正在追赶

[{

"body":

"Jazz Your Offer se abhi *303# milain aur enjoy karaen poora din 50 JazzWarid minutes siraf Rs 10 bama tax mai",

"address":"JAZZ",
"

date":"November 12, 2019","

time":"Tuesday, 10:49:45 AM"

}]

我想要什么,我想要像

这样的清晰json数组
[
  {
    "body": "Alhumdulilah.. ap snao",
    "address": "+92XXXXXXXXXX",
    "date": "October 09, 2019",
    "time": "Wednesday, 8:56:23 PM"
  },
  {
    "body": "Alhumdulilah.. ap snao",
    "address": "+923XXXXXXXXX",
    "date": "October 09, 2019",
    "time": "Wednesday, 8:56:23 PM"
  }
]

我如何在android中实现?

2 个答案:

答案 0 :(得分:0)

您可以使用

jsonString.replace(""", " ")

用空格替换"""的出现次数。

答案 1 :(得分:0)

尝试使用HtmlCompat.fromHtml来解决此问题

String formattedResponse = HtmlCompat.fromHtml(
        response, 
        HtmlCompat.FROM_HTML_MODE_LEGACY).toString();