Home > OS >  How to convert `json` object to string concatenation
How to convert `json` object to string concatenation

Time:06-10

how to convert json object

dic = {
        a:"1",
        b:"2,3",
        c:"abc"
    }

spliced into

a=1&b=2,3&c=abc

CodePudding user response:

Dictionary can be converted like this:

new URLSearchParams(json).toString()

Arrays can be converted like this:

new URLSearchParams(json).toString()
  • Related