i has the following requirement:
I have a str string that has control characters ... I want to replace these control characters with some specific values. Therefore, I use the following Regex as:
str = Regex.Replace(str, @"\p{C}+","\r\n");
The above replaces ALL control characters with \ r \ n.
However, I want to do the same above, but exclude the following control characters:
SPACE , `\u000D`, `\u000A`
How can I modify RegEx above to accomplish this? Any ideas? thank!
source
share