本文介绍了如何删除c#中括号和结束括号json之前的倒置逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

{ResCode:1,ResStrDisplay:{EmpId:16,FullName:GTPTEST,名称:软件工程师,LastActivity:登录在02 / 12/2016 15:23来自IP地址:115.118.170.121}}

我得到了这个输出。

我想要跟随输出。

{ResCode:1,ResStrDisplay:{EmpId:16,FullName:GTPTEST,指定:软件工程师,LastActivity:登录于02/12 / 2016 15:23来自IP地址:115.118.170.121}}



{ResCode:1,ResStrDisplay:{...}}我想要删除这个标记。

我想删除{..}这个marks.before支架和支架后

这是我的代码





{"ResCode":1,"ResStrDisplay":"{"EmpId":16,"FullName":"GTPTEST","Designation":"Software Engineer","LastActivity":"Sign in recorded at 02/12/2016 15:23 from IP address: 115.118.170.121"}"}
I have get this output.
I want following output.
{"ResCode":1,"ResStrDisplay":{"EmpId":16,"FullName":"GTPTEST","Designation":"Software Engineer","LastActivity":"Sign in recorded at 02/12/2016 15:23 from IP address: 115.118.170.121"}}

{"ResCode":1,"ResStrDisplay":"{...}"}i want to remove this " " marks.
I want to remove "{..}" this "" marks.before bracket and after bracket
this is my code


WebEmployees ObjWebEmp = new WebEmployees();
                   ObjWebEmp.EmpId = objUser.UserId;
                   ObjWebEmp.FullName = objUser.FullName;
                   ObjWebEmp.Designation = objUser.Designation;
                   ObjWebEmp.LastActivity = lastactivity;
                   um.ResCode = 1;
                   um.ResStrDisplay = new JavaScriptSerializer().Serialize(ObjWebEmp);





我尝试过:





What I have tried:

WebEmployees ObjWebEmp = new WebEmployees();
                   ObjWebEmp.EmpId = objUser.UserId;
                   ObjWebEmp.FullName = objUser.FullName;
                   ObjWebEmp.Designation = objUser.Designation;
                   ObjWebEmp.LastActivity = lastactivity;
                   um.ResCode = 1;
                   um.ResStrDisplay = new JavaScriptSerializer().Serialize(ObjWebEmp);

推荐答案


这篇关于如何删除c#中括号和结束括号json之前的倒置逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 21:05