我通过使用 Newtonsoft 对列表进行序列化,将 JSON 数组作为字符串,如下所示
[{"ID":"1","Name":"somename","Class":"12","Section":null},{"ID":null,"Name":"somename","Class":"13","Section":null},{"ID":2,"Name":"somename","Class":null,"Section":"A"}]
我需要通过将NULL
值删除到另一个 JSONString 来转换这个 JSON,如下所示
[{"ID":"1","Name":"somename","Class":"12",},{"Name":"somename","Class":"13",},{"ID":2,"Name":"somename","Section":"A"}]
有没有办法可以为此使用 Newtonsoft,或者我该怎么做。