Solved

Remove \ from JSON in C#

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 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

20 Experts available now in Live!

Get 1:1 Help Now