我正在使用Json.Net将DataTable转换为JSON,如下所述,但我的JSON字符串在引号前包含反斜杠字符\
。如何删除这些字符?
用于将DataTable转换为JSON字符串的C#代码:
string json = JsonConvert.SerializeObject(objAcctDTable, Formatting.None);
Json输出字符串:
"[{\"AcctID\":5822,\"AcctName\":\"1 EDI SOURCE INC (Vendor)\"},{\"AcctID\":4350,\"AcctName\":\"21C OATS, INC. (Rail Customer)\"},{\"AcctID\":5729,\"AcctName\":\"24 Waterway LLC (Leasing Company Account)\"},{\"AcctID\":3799,\"AcctName\":\"3D CORPORATE SOLUTIONS LLC (Rail Customer)\"},{\"AcctID\":4596,\"AcctName\":\"3FNP (HINES 70 WEST MADISON LP) (Vendor)\"},{\"AcctID\":6035,\"AcctName\":\"3FNP LLC (Oracle Vendor)\"},{\"AcctID\":4622,\"AcctName\":\"3M CO (Vendor)\"},{\"AcctID\":4532,\"AcctName\":\"3M COMPANY (Oracle Customer)\"},{\"AcctID\":5912,\"AcctName\":\"5th3rd, BCC (Leasing Company Account)\"},{\"AcctID\":5913,\"AcctName\":\"5th3rd, UBOC, FNBC (Leasing Company Account)\"},{\"AcctID\":5730,\"AcctName\":\"8121 Broadway Interests, LLC (Leasing Company Account)\"},{\"AcctID\":3324,\"AcctName\":\"A E STALEY MFG. (Mileage Tax Customer)\"}]"