C# 程序生成json字符串 需要把以下不需要的部分删掉 怎么操作 急(看到的大拿看看我)

(需要删除框选部分对应的后括号)
在保证json字符串格式不变的情况下进行修改
图片上传失败 具体代码我放到了评论区里

确认是C#(CSharp)语言而不是c或者C++。C#的话可以用Newtonsoft.Json.dll+匿名对象先反序列化为对象后,在遍历数据组合成题主需要的数据。这个操作也可以在客户端用js来操作如果是web项目。


{
    ("is_menu_open": 1,
    "selfmenu_info":) {
        "button": [{
            ("name": "新冠咨询",
            "sub_button":) {
                "list": [{
                    "type": "view",
                    "name": "新冠发热门诊咨询",
                    "url": "http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/zhuanjiajieshao.aspx?yuyueNo=1"
                }, {
                    "type": "view",
                    "name": "新冠心理健康咨询",
                    "url": "http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/zhuanjiajieshao.aspx?yuyueNo=1&DOCTORTYPE=2"
                }, {
                    "type": "view",
                    "name": "新冠肺炎智能咨询",
                    "url": "https:\/\/im.udeyun.cn\/udeic.html?path=http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/officelist.aspx?DOCTORTYPE=1"
                }, {
                    "type": "view",
                    "name": "新冠肺炎防控预检",
                    "url": "http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/fkyujian.aspx?yuyueNo=1&code=031AT60w3qqhDV2I191w3R9Qpi3AT60K&state=1"
                }, {
                    "type": "view",
                    "name": "新冠智能心理测评",
                    "url": "http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/healthindex.aspx"
                }]
            }
        }, {
            ("name": "就诊服务",
            "sub_button":) {
                "list": [{
                    "type": "miniprogram",
                    "name": "预约挂号缴费1",
                    "url": "pages\/extra\/home\/index",
                    "appid": "wxa5da86848ce97123",
                    "pagepath": "pages\/extra\/home\/index"
                }, {
                    "type": "view",
                    "name": "数字医院",
                    "url": "http:\/\/txwx.udeyun.cn\/Views\/index1.aspx"
                }, {
                    "type": "view",
                    "name": "预约挂号",
                    "url": "https:\/\/open.weixin.qq.com\/connect\/oauth2\/authorize?appid=wxbeb48acc2cde3abc&redirect_uri=http:\/\/txwx.udeyun.cn\/Views\/yuyueguahao.aspx&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect"
                }, {
                    "type": "view",
                    "name": "影像查询",
                    "url": "https:\/\/www.eimageglobal.com\/cloudfilm\/mainSearch?hosId=04710034"
                }, {
                    "type": "view",
                    "name": "健康卡系统",
                    "url": "http:\/\/txwx.udeyun.cn\/TXJJKXT\/QTViews\/YuYueLogin.html"
                }]
            }
        }, {
            ("name": "个人中心",
            "sub_button":) {
                "list": [{
                    "type": "view",
                    "name": "就诊服务个人中心",
                    "url": "http:\/\/txwx.udeyun.cn\/Views\/Login_Card.aspx"
                }, {
                    "type": "view",
                    "name": "新冠咨询个人中心",
                    "url": "http:\/\/wx.udeinfo.cn\/TxyyWx\/Views\/myinfo_login.aspx?page=my_info.aspx"
                }, {
                    "type": "view",
                    "name": "缴费记录",
                    "url": "https:\/\/open.weixin.qq.com\/connect\/oauth2\/authorize?appid=wxbeb48acc2cde3abc&redirect_uri=http:\/\/txwx.udeyun.cn\/Views\/jiaofeijilu.aspx&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect"
                }]
            }
        }]
    }
}

用()括出来的地方为需要删除的地方,包括其后面的大括号

用获取需要的方法比较方便

图片上传失败了,请重新上传一下。