Json.Serialization.JsonFormatter.SplitArrayStrings C# (CSharp) Method

SplitArrayStrings() private method

Splits a sprecified string in parts according to JSON array definition
private SplitArrayStrings ( string s ) : ArrayList
s string string to be parsed
return System.Collections.ArrayList
        private ArrayList SplitArrayStrings(string s)
        {
            ArrayList sl = new ArrayList();
            int x = s.IndexOf('{');
            int nb = 1;
            int sp = x;
            while (sp >= 0 && x >=0)
            {
                //nb++;
                int nc = s.IndexOf('}', x + 1);
                if (nc < 0) break;
                int no = s.IndexOf('{', x + 1);
                if (nc < no || no < 0)
                {
                    nb--;
                    x = nc;
                }
                else
                {
                    nb++;
                    x = no;
                }
                string s1 = no < 0 ? string.Empty : s.Substring(no);
                string s2 = nc < 0 ? string.Empty : s.Substring(nc);
                string sx = x < 0 ? string.Empty : s.Substring(x);

                if (nb == 0)
                {
                    sl.Add(s.Substring(sp, nc - sp + 1));
                    sp = no;
                }
            }

            return sl;
        }