I have a string containing new line code like this:
string line= "This is a line\nThis is another";
I would like to be able to translate "\n" to Environment.NewLine. "\n" is just one example, I would like to translate all or most special characters like tab "\t" for example as well.
I looked at this post: Can I convert a C# string value to an escaped string literal
However, the goal is not to write to console but to replace a string to a special character constant (like Environment.NewLine).
How can I do this the best way?