I used to wonder, if I coud somehow represent "\" as "\" instead of the escape sequence for black slash ("\\") in string. I have precisely come across this feature today in C-sharp and I would like to share it with you all.Especially in my last articles when I used the paths I did not feel like using "\\".
Other than the regular string literals, C# supports what is called as Verbatim string literals.Verbatim string literals begin with @" and end with the matching quote. They do not have escape sequences.
So the statement:
is same as:
What is needed to compile?
How to Compile?
public class TestVerbatimStrings
public static void Main()
// @"c:\tEST\TEST.doc" is same as "c:\\tEST\\TEST.doc"