Solved

Remove \ from JSON in C#

Posted on 2014-03-21
2
1,948 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now