My application makes API calls and receives data in a single string. The data looks something like this: [{"city_mpg": 16, "cylinders": 6, "displacement": 2.8}]
My plan was to extract data from this string and assign it to variables
ex. var cylinders = 6
Is that even possible?
EDIT:
After following this post I solved the problem with ease. Turns out i was looking at it wrong.
My plan was to extract data from this string and assign it to variables ex. var cylinders = 6can you show how you tried to do this ? could it be that this data is perhaps using a common format, like Json, which you could parse and make your life simpler ?I tried using .contains() but to no avail.what does contains do ? how did you try to use that to solve your problem here ?