I have a section on my server that looks like this:
private static dynamic Data;
string ArraySize = "[900,900,2]";
Data = new { c2array = true, size = ArraySize };
System.IO.File.WriteAllText("json.txt", JsonConvert.SerializeObject(Data));
which spits this out:
{"c2array":true,"size":"[900,900,2]"}
yet in JavaScript I can get it to this with json.stringify:
{"c2array":true,"size":[900,900,2]} <--- no quotes
how can i get the c# JSON serialize to not wrap quotes around the string.
I'm using a string value because if I try the following
Data = new { c2array = true, size = [900,900,2] };
it won't compile
the client script I'm sending this to is a game programming library in JavaScript and it expects the size without quotes.