i have a this simple object:
{
"props[EYE][0]": "Yellow",
"props[EYE][1]": "Blue",
"props[BODY][0]": "BATMAN",
"props[BODY][1]": "SUPERMAN"
}
now i want to change this object to something like this
{
"props-EYE": ["Yellow", "Blue"],
"props-BODY": ["BATMAN", "SUPERMAN"]
}
the [EYE] and [BODY] are Dynamic and it's not a static data... what is the best way to convert?
thank you for your help...
I try to spilt keys and make new ones but the function still finds the first value.