0

I got a JSON object. After parsing the output looks something like this:

{"RMPM":"\/Date(1415094949000)\/","S&P\u0027s":"\/Date(1415094949000)\/","Moody\u0027s":"\/Date(1415094949000)\/"}

Can anyone please let me know an elegant way of making it a clean JSON object. I want to remove / and u0027s from the output.

Thanks Shiva

Tim
  • 41,901
  • 18
  • 127
  • 145
Shiva
  • 1
  • 2

1 Answers1

0
stringname = stringname.Replace("/", "").Replace("\\u0027s", "");
LukAss741
  • 771
  • 1
  • 7
  • 24
  • Hi LukAss741 Many thanks for you quick reply.I did the same thing using replace but I have a question.Is it possible to remove it using regular expression.Sorry for not specifying that while posting the question.Appreciate your response. – Shiva Dec 07 '14 at 18:09
  • Probably with Regex.Replace http://msdn.microsoft.com/en-us/library/e7f5w83z(v=vs.110).aspx . But I am not one of those who can write regular expressions by heart so you would need to figure out how should its patter be written. Anyway at the end it would do the same thing. The only difference is that with .Remove you specify the text you want to replace directly while with Regex.Replace you write it as a regular expreession. – LukAss741 Dec 07 '14 at 18:41
  • These are solutions to get rid specifically of "/" and "\\u0027s". If you want to remove any \\u00** and other then you might be looking for something like this http://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode – LukAss741 Dec 07 '14 at 18:42
  • or http://stackoverflow.com/questions/9303257/how-to-decode-a-unicode-character-in-a-string – LukAss741 Dec 07 '14 at 18:52