Remove \r from string
You need to assign the result back to text
, like:
text = text.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");
text.Replace
returns the newly modified string. It does not change the string it is operating against. So make sure you are capturing the return value.
You're close:
text = text.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");
You have to assign the result of the .Replace operation back to the string itself (or another one). Otherwise the result goes nowhere.