Ive parsed a text file into a List<string> object and the test file contains \n and \t, however once I output the strings to console they appear as “\n” and “\t” rather than a new line and a tab.
At the moment i’m using myList[i].Replace(@"\n", "\n").Replace(@"\t", "\t") but this seems a little cumbersome, especially if more escape sequences need to be added in the future.
Is their any way to un-escape the escaped sequences? Something like string.UnEscape would be just to perfect.
I’m not sure if this will do exactly what you’re after but there is an
Unescapemethod in theRegExnamespace.