OurSonic.Jsonner.get C# (CSharp) Method

get() public method

public get ( ) : string
return string
        public string get()
        {
            var ch = new char[] { '{', '}', '[', ']', ',', ' ', ':', '=' };

            string[] d = Text.Split(ch, StringSplitOptions.RemoveEmptyEntries);

            var f = d.GroupBy(a => a).OrderByDescending(a => a.Count());
            StringBuilder sb = new StringBuilder();
            int index = 0;
            string fc = "";
            int oldLen = Text.Length;
            foreach (var c in f)
            {
                if (!Enumerable.Range(0, 10).Any(a => c.Key.StartsWith(a.ToString())))
                {

                    Text = Text.Replace(c.Key, "&" + index++);
                    fc += "&" + c.Key;
                }
                if (Text.Length > oldLen)
                {
                    Console.Write("");
                    break;
                }
                oldLen = Text.Length;
            }
            Text = fc.Length + fc + Text;
            return Text;
        }