I would like to do a simple addslash to a string in c#.
My string is (for example) : "bla bla ' bla bla" And i would like the new string to be : "bla bla \' bla bla".
Unfortunately, when i do
str.Replace("'", "\'") or str.Replace("'", "\\'")
or a lot of other combination i end up with :
"bla bla \\' bla bla". I don't get it to just have one backslash.
Do you guys have some ideas ?
Thanks