0

How to convert given string:

[1:["price":100, "dataAmount":0.5], 3:["price":300, "dataAmount":1], 5:["price":500, "dataAmount":2], 7:["price":700, "dataAmount":3], 10:["price":1000, "dataAmount":5], 31:["price":3100, "dataAmount":15], 365:["price":36000, "dataAmount":1024], 39:["price":3900, "dataAmount":20, "daysValid":31], 93:["price":9000, "dataAmount":150]]

to JSON in Kotlin ?

I tried to aply JSONObject()

  • 2
    There are many JSON libraries available for Java and Kotlin. You have to be specific about which one you're using, and please show the code you tried so we only have to explain what to fix, instead of wondering if we need to explain everything from scratch to be able to help. – Tenfour04 Jan 13 '23 at 14:32
  • Does this answer your question? [How to create a JSONObject from String in Kotlin?](https://stackoverflow.com/questions/44295665/how-to-create-a-jsonobject-from-string-in-kotlin) – Nishant Jalan Jan 13 '23 at 14:57

0 Answers0