I am using JObject.ToString()
method to convert JSON object to string. But how can I trim output to delete spaces between tokens?
Asked
Active
Viewed 1.2k times
2 Answers
21
No need to resort to using Regex. Just use the Formatting.None
option:
string json = jObject.ToString(Formatting.None);

Brian Rogers
- 125,747
- 31
- 299
- 300