Sometimes it is necessary to work with characters that are not displayed on the keyboard or with characters that have special meanings, such as the “new line” character. They cannot be represented directly in the source code of the program and in order to use them we need special techniques, which we
will discuss now.
Escaping sequences are literals. They are a sequence of special characters, which describe a character that cannot be written directly in the source code. This is, for instance, the “new line” character. There are many examples of characters that cannot be represented directly in the source code: a double quotation mark, tab, new line, backslash and others.
Here are some of the most frequently used escaping sequences:
static void Main(string args)
string quotation = "\"Hello, Mike\", he said.";
string path = "C:\\Windows\\Notepad.exe";
string verbatim = @"The \ is not escaped as \\.
I am at a new line.";