Solved

Remove \ from JSON in C#

Posted on 2014-03-21
2
2,126 Views
Last Modified: 2014-03-28
I am getting JSON Data like below,But I can not remove "\" from the below output. I am using C#.I have used replace method in c# to remove \ , but no result.

"[{\"Security\":\"OFS IB Equity\",\"Display\":\"ODYSSEYCORP, BSE, INDIA\",\"Esignal\":\"\"},{\"Security\":\"OFS IB Equity\",\"Display\":\"ODYSSEYCORP, BSE, INDIA\",\"Esignal\":\"\"},{\"Security\":\"OFS IB Equity\",\"Display\":\"ODYSSEYCORP, BSE, INDIA\",\"Esignal\":\"\"},{\"Security\":\"OFS IB Equity\",\"Display\":\"ODYSSEYCORP, BSE, INDIA\",\"Esignal\":\"\"},{\"Security\":\"OFS IB Equity\",\"Display\":\"ODYSSEYCORP, BSE, INDIA\",\"Esignal\":\"\"}]"
0
Comment
Question by:dynamicweb09
2 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 39945582
Can you post what you've tried?
0
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 39946399
I'm not sure what your end-purpose is. In C#, the string, "\"" is in fact, actually the quote symbol in a string. In effect, this is """. So, you'd have a string like this:

string myString = "\"Hello\""; // string is "Hello" not Hello

Open in new window


You can't really "remove" the \" from a string and keep it a valid string.

You could try this:
string xyz = jsonData.Replace('\"',' ');

Open in new window


That will replace the quote with a space. Maybe that will be what you need?
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question