I am looking for a good way to convert string like:
"[apples, oranges, [strawberries, peas, grapes]]"
into an array which will look like:
array = [apples, oranges, [strawberries, peas, grapes]].
therefore array[0] = ["apples"], array[1] = ["oranges"], and array[2] = ["strawberries", "peas", "grapes"]
So, whenever in my string I have another inner square brackets, the content between brackets will be a subarray of my base array.
array = [apples, oranges, [strawberries, peas, grapes]], thenarray[0]is not["apples"], nor is it"apples", but is whatever value that is assigned to the variableapples.