saraswathi
saraswathi

Reputation: 69

Convert a JSON into a list of key value pair

I have a string which has multiple JSON in it of the format:

ID,{JSON},
ID,{JSON},
ID,{JSON}  

I want to convert this into a list of key-value pairs in which each key-value pair is of the format mentioned below:

{
 Key: "ID",
 Value: {JSON}
}

Let me know how I can achieve this.

Upvotes: 0

Views: 393

Answers (1)

Alex
Alex

Reputation: 1033

You could convert your strings into a serializable class with two properties key and value and serialize it.

Upvotes: 1

Related Questions