Verbatim string literals
Verbatim string literal does not require the use of escape characters to define special characters. Instead, any information in the source code, including new lines, is included in the string. To define a string literal an @ symbol is placed before the opening quotation mark. Verbatim string literals are often used for specifying paths and multi-line string.
Example code:
string path = @"C:\Program Files\My Program"; //verbatim literal string path2 = "C:\\Program Files\\My Program"; //regular literal string msg = @"Hello, This is a multi-line string"; //verbatim literal string msg2 = "Hello,\nThis is multi-line string"; //regular literal
The only character that requires a different action is the quotation mark itself, which must be entered twice to indicate a single character.






