Regular String Constants and Verbatim (@) String Constants : Verbatim literal strings « String « C# / CSharp Tutorial






using System;

public class MainClass {
    public static void Main() {

        Console.WriteLine("\u0041BC");           // ABC 
        Console.WriteLine(@"\u0041BC");          // \u0041BC 
        Console.WriteLine("Say \"Hello\"!");     // Say "Hello"! 
        Console.WriteLine(@"Say ""Hello""!");    // Say "Hello"! 
        String s1 = @"Line 1 
and Line 2";                             // Newline allowed only in verbatim string 
        String s2 = "Line 1\nand Line 2";        // s1 and s2 are equal 

    }

}








5.2.Verbatim literal strings
5.2.1.Verbatim Strings
5.2.2.Verbatim literal strings: multiple line string
5.2.3.Verbatim literal strings: quote
5.2.4.Regular String Constants and Verbatim (@) String Constants