I have a string like
String str = "(3456,"hello", world, {ok{fub=100, fet = 400, sub="true"}, null }, got, cab[{m,r,t}{u,u,r,}{r,m,"null"}], {y,i,oft{f,f,f,f,}, tu, yu, iu}, null, null)
Now I need to split this string based on comma(,) but the strings which are between {} and [] should not be split. So my out put should look like
3456
hello
world
{ok{fub=100, fet = 400, sub="true"}, null}
got
cab[{m,r,t}{u,u,r,}{r,m,"null"}]
{y,i,oft{f,f,f,f,}, tu, yu, iu}
null
null
I know that it looks strange, I can do it by using old traditional brute force methods, but I need if there is any simplest logic for these kind of problems.
Can any one help me?
Thanks in advance :-)