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
  • 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. Commented Jan 13, 2023 at 14:32
  • Does this answer your question? How to create a JSONObject from String in Kotlin? Commented Jan 13, 2023 at 14:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.