Hi
I want to remove outer json array in c#. please help
Input JSON
[{
"result1": [{
"number": "string",
"id": "string"
}]
},
{
"result2": [{
"number": "string",
"id": "string"
}]
}]
[Output JSON]
{
"result1": [
{
"number": "string",
"id": "string"
}
],
"result2": [
{
"number": "string",
"id": "string"
}
]
}

Mohammad HussainPosted Aug 21, 2023, 12:02 PM
Cr BhargaviPosted Aug 23, 2023, 1:22 PM
Please use the Newtonsoft.Json library for removing outer json array in c#
Deepak RawatPosted Aug 21, 2023, 12:02 PM
You want to remove the outermost JSON array from the input JSON and keep the inner objects intact. You can achieve this by parsing the input JSON, extracting the inner objects, and creating a new JSON object with those inner objects.
Amit MohantyPosted Aug 21, 2023, 10:52 AM
To remove the outer JSON array in C#, you can use a JSON library like Newtonsoft.Json