0

I'm trying to print \"Hey\" in the Console But when I run it It just print the "Hey" without \ and when i put another \ in the beginning and \ in end it says theres an Error

Farhad Zamani
  • 5,381
  • 2
  • 16
  • 41
Eden Ichak
  • 13
  • 6

1 Answers1

4

You have to escape the " as well as the \. Both should be escaped with a backslash itself. Your final result should look something like: Console.WriteLine("\\\"Hey\\\"");

Marian Klösler
  • 620
  • 8
  • 22