harish reddy

harish reddy

  • NA
  • 95
  • 4.7k

Output query - Console

May 30 2017 10:52 PM
string quotation = "\"Hello, Jude\", he said.";
Console.WriteLine(quotation); string path = "C:\\Windows\\Notepad.exe";
 
Console.WriteLine(path); string verbatim = @"The \ is not escaped as \\. I am at a new line.";
 Console.WriteLine(verbatim);
 
// Console output: 
// "Hello, Jude", he said.
// C:\Windows\Notepad.exe
// The \ is not escaped as \\.
// I am at a new line.
 
 
Question: Why the console out put for each variable is missing "\".
example :"\"Hello, Jude\", he said."; is outputted as  "Hello, Jude", he said. . Why?
"C:\\Windows\\Notepad.exe"; is outputted as C:\Windows\Notepad.exe . Why?
Similarly other one? why?

Answers (1)