JObject tostring formatting issue for JArray
问题 I have a question or rather an issue with the JObject. This is just a small example, I have large lists with more than 20 elements and I am saving these in JSON format and it is really bad to read if every value is in a new line. Can someone explain to me how to fix this? Code: var myObj = new { Vector = new List<int>{ 1,2,3,4,5 } }; Console.WriteLine(JToken.FromObject(myObj).ToString(Formatting.Indented)); Output is like this: { "Vector": [ 1, 2, 3, 4, 5 ] } But I want it to be like this: {