I have a string that will be like this:
[
{
"info": "thing 1 by person 1",
"glow": "0xff9900",
"glowalpha": 1,
"glowsize": 2,
"glow2": "0xabcdef",
"glowalpha2": 1,
"glowsize2": .4,
"glow3": "0x1e1e1e",
"glowalpha3": .5,
"glowsize3": .1,
"paletteSwap"{
"colors":[0,-500]
"replacements":[-26368,99]
},
"paletteSwapPA"{
"colors":[0,-500]
"replacements":[-26368,99]
}
},
{
"info": "another thing by person 2",
"glow": "0xff9900",
"glowalpha": 1,
"glowsize": 2,
"paletteSwap"{
"colors":[0,99,76,832638]
"replacements":[-26368,847261,9387,92812]
},
"paletteSwapPA"{
"colors":[0,99,76,832638]
"replacements":[-26368,847261,9387,92812]
}
},
//and so on. The last "phrase" won't have a comma at the end.
]
I can get rid of the beginning and ending [ ] easily—that's easily handled by Substrings. How do I manage to separate those "phrases" into an ArrayList, such as
thing[0] =
{
"info": "thing 1 by person 1",
"glow": "0xff9900",
"glowalpha": 1,
"glowsize": 2,
"glow2": "0xabcdef",
"glowalpha2": 1,
"glowsize2": .4,
"glow3": "0x1e1e1e",
"glowalpha3": .5,
"glowsize3": .1,
"paletteSwap"{
"colors":[0,-500]
"replacements":[-26368,99]
},
"paletteSwapPA"{
"colors":[0,-500]
"replacements":[-26368,99]
}
}
, thing[1] =
{
"info": "another thing by person 2",
"glow": "0xff9900",
"glowalpha": 1,
"glowsize": 2,
"paletteSwap"{
"colors":[0,99,76,832638]
"replacements":[-26368,847261,9387,92812]
},
"paletteSwapPA"{
"colors":[0,99,53315]
"replacements":[-26368,847261,67543]
}
}
and so on? I simply can't use .split(',')—that would also separate the things inside the "phrases", and I wouldn't easily be able to glue them back together, because there's no consistent line count for them.
What do I do?