I'm using this code to remove unprintable characters from the string but I don't want to remove new line characters (\n) from the string. Here's the code I use for now.
Regex.Replace(value, @"\p{C}+", string.Empty)
I don't know about Regex. I found this code on the Internet. It works but it removes new line control characters too. I was wondering how I can do what I want. (Regex is not compulsory)