Newtonsoft.Json 时间格式设置,替换null为""

前端之家收集整理的这篇文章主要介绍了Newtonsoft.Json 时间格式设置,替换null为""前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


Newtonsoft.Json.JsonSerializerSettings jSetting = new Newtonsoft.Json.JsonSerializerSettings();

jSetting.NullValueHandling = Newtonsoft.Json.NullValueHandling.Include;

jSetting.DateFormatString = "yyyy-MM-dd HH:mm:ss";

sbContent.Append(JsonConvert.SerializeObject(gameresult,jSetting).Replace(":null,",":\"\",").Replace(":null},":\"\"},"));

猜你在找的Json相关文章