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},":\"\"},")); 原文链接:https://www.f2er.com/json/289876.html

猜你在找的Json相关文章