Regular String Constants and Verbatim (@) String Constants : Verbatim literal strings : String C# Examples


C# Examples » String » Verbatim literal strings »

 

Regular String Constants and Verbatim (@) String Constants









    
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  

        }

}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» Verbatim literal strings