I have a JsonArray Object like
JsonArray[0]= { "streetName" : "xyz", "wardName" : "12xz"}
JsonArray[1]= { "doorNumber" : "123", "plot" : "90z"}
JsonArray[2]= { "city" : "pqr", "district" : "nmc"}
JsonArray[3]= { "state" : "hisd", "country" : "kasps"}
I want to convert above JsonArray into JsonObject which will be like
{
"addresss":[ {
"streetName": "xyz",
"wardName": "12xz",
"doorNumber": "123",
"plot": "90z",
"city": "pqr",
"district": "nmc",
"state": "hisd",
"country": "kasps"
}]
}
I tried in different ways using Json Objcet put and traversing JSONarray and appending the value to String builder. No use. any one give me some idea. how to do that. Thanks for your help.