从json字符串中的键中删除引号

时间:2017-08-04 06:00:58

标签: javascript angular

我们如何从json string中的键中删除引号。请帮助。

我的JSON数据 -

{
  "condition": "AND",
  "rules": [{
      "id": "amount",
      "operator": "greater_or_equal",
      "value": "900"
    },
    {
      "condition": "AND",
      "rules": [{
          "id": "vendorname",
          "Operator": "equal",
          "value": "US BANK NATIONAL ASSOCIATION"
        },
        {
          "id": "vendorname",
          "Operator": "equal",
          "value": "HANSEN SOLUTIONS  LLC"
        }
      ]
    }
  ],
}

我想在下面实现:

{

  condition: "AND",
  rules: [{
      id: "amount",
      operator: "greater_or_equal",
      value: "900"
    },
    {
      condition: "AND",
      rules: [{
          id: "vendorname",
          operator: "equal",
          value: "US BANK NATIONAL ASSOCIATION"
        },

        {
          id: "vendorname",
          operator: "equal",
          value: "HANSEN SOLUTIONS  LLC"
        }
      ]
    }
  ],

}

0 个答案:

没有答案