Search This Blog

Tuesday, January 29, 2013

Escape sequences (C#)



C# > Escape sequences

The special escape character is the backslash character (\).
\" Display a double quotation mark.
\'  Display a single quotation mark.
\\  Display a backslash.
\0 Null
\a Alarm
\b Backspace
\f Form feed
\n Newline
\r Carriage return
\t Tab
\v Vertical tab
  
string msg = "Dan said: \"Hello world!\"";
Result is:
Dan said: "Hello world!"

string path = "C:\\MyDir";
Result is:
C:\MyDir