I would like to read a line from a file, and use that line as the format specifier for a string.
The line in the file contains a newline character escape sequence \n. so it may look like this:
Hello{0}\n\nWelcome to the programme
And I want to use it in a situation like this:
string name_var = "Steve";
string line = ReadLineFromFile();
string formatted_line = String.Format(line, name_var);
Unfortunately, the result looks like:
Hi Steve\n\nWelcome to the programme
Whereas I'd like it to look like:
Hi Steve
Welcome to the programme
Any ideas?