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?
The replace doesn't work because ’
and '
are not the same character.
And maybe you forgot to capture the result, your code is too short to tell.
’
and '
are different characters. You also need to assign it somewhere (strings are immutable), Replace()
returns new string:
myString = myString.Replace("’", "'");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With