C# - How can I convert an escaped string into a literal string? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Can I expand a string that contains C# literal expressions at runtime How can I convert an escaped string read from a file at runtime, e.g. "Line1\nLine2" into its literal value: Line1 Line2 Amazingly I have found an example to do the opposite here using CSharpCodeProvider(), which seems like it would be the more difficult conversion. In order to do the opposite it appears I need to generate code to define a