I am using the JObject.ToString() method to convert a JSON object to a string. But how can I trim the output to remove spaces between tokens?
JObject.ToString()
No need to resort to using Regex. Just use the Formatting.None parameter:
Formatting.None
string json = jObject.ToString(Formatting.None);
JsonConvert.SerializeObject (myJson);
Json.Net SerializeObject