Tutorial by Examples

var multiLine = @"This is a multiline paragraph"; Output: This is a multiline paragraph Live Demo on .NET Fiddle Multi-line strings that contain double-quotes can also be escaped just as they were on a single line, because they are verbatim strings. var multilineWithDoubleQ...
Double Quotes inside verbatim strings can be escaped by using 2 sequential double quotes "" to represent one double quote " in the resulting string. var str = @"""I don't think so,"" he said."; Console.WriteLine(str); Output: "I don't think s...
Verbatim strings can be combined with the new String interpolation features found in C#6. Console.WriteLine($@"Testing \n 1 2 {5 - 2} New line"); Output: Testing \n 1 2 3 New line Live Demo on .NET Fiddle As expected from a verbatim string, the backslashes are ignored as escap...
In a normal string, the backslash character is the escape character, which instructs the compiler to look at the next character(s) to determine the actual character in the string. (Full list of character escapes) In verbatim strings, there are no character escapes (except for "" which is ...

Page 1 of 1