简体   繁体   中英

Replace a character by a line break

I have a ajax server response

{
    "applicationBankList": [
        {
            "id": "${addressId}",
            "accountNumber": "",
            "accountName": "",
            "paymentMethodCode": "DRDEB",
            "name": "BANKOFENGLAND",
            "yearsWithBank": "8",
            "bankSortCode": "100000",
            "monthsWithBank": "8",
            "branch": "HeadOffice",
            "sortCode": "10-00-00",
            "validationInformation": "",
            "validationStatus": ""
        }
    ],
    "applicationBillingAddress": {
        "defaultFlag": "Y"
    }
}

I need to make it much human readable by aligning them properly, i have huge set of responses its quite very hard to read them so i am looking for a solution which automatically formats for human readability is there any solution for this

Just wanting it pretty defeats the purpose of using json. It's meant to be compact, adding spaces, line breaks, and indents, goes against the grain.

If you want to debug or check the structure of it: http://jsonlint.com/

I think making it "human-readable" has to be done on the server-side. What you are getting is the server-response, the way it is sent. Do you have access to the server code that returns the response string?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM