I have an input Json string like this:
var x= "[{\"name\":\"ahmed\",\"age\":\"26\"},
{\"name\":\"Sam\",\"age\":\"25\"}]"
I want to split it to a list of strings from{ to } as follows without removing a delimiter
var list;
list[0]= {\"name\":\"ahmed\",\"age\":\"26\"}
list[1]= {\"name\":\"Sam\",\"age\":\"25\"}
using the split method removes the delimiter and does not yield the correct format
x= x.replace(/\[\/]/g, '/'); //to remove [ and ]
x= x.replace( /},/ ,'}\n' ); // does not split the string to list of strings
list = x; // type mismatch error since x is a string and list is array