I have the following JSON in which some attributes have empty string i.e. "" or null values
{
"allOrNone":false,
"records":[
{
"Address__c":"Street",
"ConsentToComm__c":"",
"EmailCLDate__c":"",
"attributes":{
"type":"Stage_FF_Hot_Alerts__c"
}
}
]
}
I have to remove the empty string and null value attributes from this JSON. How can i remove them. I am doing this in C#. Required JSON after removing empty strings and null would be:
{
"allOrNone":false,
"records":[
{
"Address__c":"Street",
"attributes":{
"type":"Stage_FF_Hot_Alerts__c"
}
}
]
}