CSharp examples for Language Basics:string
A verbatim string literal is prefixed with @ and does not support escape sequences.
string a2 = @ "\\server\fileshare\helloworld.cs";
A verbatim string literal can also span multiple lines:
using System;//w ww . j a va2 s .c o m class Test { static void Main(){ string escaped = "First Line\r\nSecond Line"; string verbatim = @"First Line Second Line"; Console.WriteLine (escaped); Console.WriteLine (verbatim); } }
You can include the double-quote character in a verbatim literal by writing it twice:
using System;/* w ww. j a va2 s .co m*/ class Test { static void Main(){ string xml = @"<customer id=""123""></customer>"; Console.WriteLine (xml); } }