I’m trying to replace apostrophes with a string, for some reason the method just doesn’t find the apostrophe in the string. Here is the URL that just doesn’t seem to work:
"/news/2012/march/cameron’s-crackdown-on-whiplash-–-why-the-minimum-speed-requirement-is-oddly-suspicious"
.Replace("'", "'");
Does anyone have any ideas?
Strings are immutable types. You can’t change them. Even if you think you change them, you create a new strings object.
String.Replace()method also returns a new string by the way.Try to assign in a new string reference with
"’"not"'".