\
is used as an escape character in strings. Escape characters are used to encode special "non printed" characters inside a string like \n
is new line \"
is a quote etc. Because \
is the escape character, in order to write a \
we have to escape it and write it as \\
this shows up as a double slash in code and if you view the string in a debugger but both in memory and when it's printed to the screen it appears as 1.
For instance
string s = "The quick \"brown\" fox jumped\nOver the lazy dog. \\\\o_o//";
will print to the screen as
The quick "brown" fox jumped
Over the lazy dog.\\o_o//
Some light reading on escape sequences and you'll be good to go
Verbatim strings, made in C# by @""
will treat everything as literal and don't have escape characters, if you want a newline you have to write the string over 2 lines. The only escape you can do in a verbatim string is "
and that's done by ""
string s = @"The quick ""brown"" fox jumped
Over the lazy dog. \\o_o/";
will have the same output as the escaped string above
The quick "brown" fox jumped
Over the lazy dog.\\o_o//