Verbatim Strings

Download c# eBook

Syntax

  • @"verbatim strings are strings whose contents are not escaped, so in this case \n does not represent the newline character but two individual characters: \ and n. Verbatim strings are created prefixing the string contents with the @ character"

  • @"To escape quotation marks, ""double quotation marks"" are used."

Remarks

To concatenate string literals, use the @ symbol at the beginning of each string.

var combinedString = @"\t means a tab" + @" and \n means a newline";

Related Examples

Stats

1360 Contributors: 26
Thursday, April 6, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook