1
I have the following string, which will actually be treated as a json
, stored in a column in the database in my SQL Server
:
{"PT":"adssadsadsd "asdada"","ES":"","FR":"","EN":""}
How do I automatically change the string to look like the following:
{"PT":"adssadsadsd \"asdada\"","ES":"","FR":"","EN":""}
I want to make that change in Controller of my project MVC. I need this because I have records in the database that are badly formatted and then I can’t get the information in the right way.
before mounting your JSON you can call
string.Replace("\"", "\\\"")
– andrepaulo
That won’t change all the quotes instead of just changing the ones I mentioned?
– ihavenokia
if you place after the Json is mounted the answer is yes. , if you can[ivel put the code that generates the JSON there I can tell you for sure.
– andrepaulo
but I can’t do Parse because of those quotes, give me Exception
– ihavenokia
you’re storing the entire JSON in your database field? That’s it?
– andrepaulo
exact! I don’t know it’s the best, but it was already like this when I picked up the project
– ihavenokia