I have a string like this
var str = "error,#FFFFFF,won,25,[{\"color\":\"#7ac1de\",\"from\":\"10\",\"to\":\"60\"}]"
I will be splitting the string based on comma (',') in the string. But i need to split the string with out affecting comma inside [{\"color\":\"#7ac1de\",\"from\":\"10\",\"to\":\"60\"}]
.
So my expected output will be ['error', '#FFFFFF', 'won', '25', '[{"color":"#7ac1de","from":"10","to":"60"}]']
.
I tried with many ways but not working. Please help me.