Simon
Simon

Reputation: 1

Error with C# String.Replace for double quote

I'm using the following to convert a string containing " to the actual double quote symbol ".

string correctname = name.Replace(""", "\"");

It actually returns backslash followed by double quoted: ' \" '. What am I doing wrong? Thank you.

Upvotes: 0

Views: 383

Answers (1)

Matías Fidemraizer
Matías Fidemraizer

Reputation: 64933

Actually it's working: a double quot is shown using a escape sequence when you watch it using the debugger.

BTW, I believe you should use WebUtility.HtmlDecode if you're looking for decoding HTML entities.

Upvotes: 3

Related Questions