Change default null value in JSON.NET
问题 Is there some way to set what the default representation for null values should be in Json.NET? More specifically null values inside an array. Given the class public class Test { public object[] data = new object[3] { 1, null, "a" }; } Then doing this Test t = new Test(); string json = JsonConvert.SerializeObject(t); Gives {"data":[1,null,"a"]} Is it possible to make it look like this? {"data":[1,,"a"]} Without using string.Replace. 回答1: Figured it out. I had to implement a custom