Hi guys. I know some of you are not satisfied with the frequency new tips appear on this site. The last comment I received was a proposal to rename the site to .NET Tip of The Month :) But I don't want to do this because I'm going to fix this problem. I'm working on the .NET Tips & Tricks Community section now. My tips that are too small to hit the front page were added to this section. It's the place where all of you can share your .NET tips and tricks.
It's clear that this section lacks for some features. And if anyone out of 2510 subscribers has a proposal, just drop me a line. My email is kostya.ly@gmail.com.
Thanks for you patience.Kostya Ly
Verbatim string literal does not require the use of escape characters to define special characters. Instead, any information in the source code, including new lines, is included in the string. To define a string literal an @ symbol is placed before the opening quotation mark. Verbatim string literals are often used for specifying paths and multi-line strings:
string path = @"C:\Program Files\My Program"; //verbatim literal
string path2 = "C:\\Program Files\\My Program"; //regular literal
string msg = @"Hello,
This is a multi-line string"; //verbatim literal
string msg2 = "Hello,\nThis is multi-line string"; //regular literal
P.S. the only character that requires a different action is the quotation mark itself, which must be entered twice to indicate a single character.