Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 查找并列出一个Json文件中不在另一个Json文件中的文本_C#_Json_.net Core - Fatal编程技术网

C# 查找并列出一个Json文件中不在另一个Json文件中的文本

C# 查找并列出一个Json文件中不在另一个Json文件中的文本,c#,json,.net-core,C#,Json,.net Core,我试图在我的一个JSON文件中找到其他JSON文件中不存在的所有ID 我还没有尝试过任何东西,因为我不知道如何接近它 第一个JSON文件示例: { "id": "TestLinkOne", "displayText": "Test Link Text", }, { "id": "Test", "response": [ { "text": "Hello", "ids": [ "TestLinkOne

我试图在我的一个JSON文件中找到其他JSON文件中不存在的所有ID

我还没有尝试过任何东西,因为我不知道如何接近它

第一个JSON文件示例:

{
    "id": "TestLinkOne",
    "displayText": "Test Link Text",
},
{
    "id": "Test",
    "response": [
      {
        "text": "Hello",
        "ids": [
          "TestLinkOne",
          "TestLinkTwo"
        ]
      }
    ]
  },
第二个JSON文件示例:

{
    "id": "TestLinkOne",
    "displayText": "Test Link Text",
},
{
    "id": "Test",
    "response": [
      {
        "text": "Hello",
        "ids": [
          "TestLinkOne",
          "TestLinkTwo"
        ]
      }
    ]
  },

我想返回第一个JSON文件中不在第二个JSON文件中的所有ID的列表。

您想在后端执行此操作,对吗?JSON只是一个奇特的字符串。您可以通过正则表达式或string.Substring(/*args here*/)操作字符串;或者类似的,然后比较数组/列表/哈希集的联合/差异。您想在后端执行此操作,对吗?JSON只是一个奇特的字符串。您可以通过正则表达式或string.Substring(/*args here*/)操作字符串;然后比较数组/列表/哈希集的并集/差集。