In C and C++, string has some special characters called "escape characters". For example \
, &
and the "
itself is an escape character!
In the very normal way, you to print a statement like:
Nancy Said Hello World! & smiled
you had to set your string like next
string str = "Nancy said Hello World! \& smiled.";
But people in Microsoft made a new cool feature in C# compiler so you can escape the headache of handling the escape characters by adding @
before any string, and the compiler will handle all the escape characters for you by himself. For the last example you can have this in C# like next:
string str = @"Nancy said Hello World! & smiled.";