StandaloneNode.JSONObject.CreateFromString C# (CSharp) Method

CreateFromString() public static method

Creates a JSONObject by parsing a string. This is the only correct way to create a JSONObject.
public static CreateFromString ( string s ) : JSONObject
s string
return JSONObject
        public static JSONObject CreateFromString(string s)
        {
            object o;
            JavaScriptSerializer js = new JavaScriptSerializer();
            js.MaxJsonLength = Int32.MaxValue;
            try
            {
                o = js.DeserializeObject(s);
            }
            catch (ArgumentException ae)
            {
                throw ae;// new Exception("JSONException", "Not a valid JSON string.");
            }

            return Create(o);
        }