我有生成的JSON字符串如下:卸下條目
System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(Data));
System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(mdata.GetType());
MemoryStream ms = new MemoryStream();
serializer.WriteObject(ms, mdata);
string json = Encoding.UTF8.GetString(ms.ToArray());
我想在MDATA結構中的空條目不存在於JSON字符串所以是有一個簡單的方法,以這樣做(不必解析json字符串)?
感謝