By 22/07/2015 13 Comments

C# Verbatim String Literal

  • It specifies with a @ symbol followed by double quotes (@””).
  • By using it, we can write contents of multiple string lines and also can span more than one line.
  • We can include new lines, tabs, double quotations etc in it without using escape sequences (describes as above).
  • Notice, it displays our string literals as is at runtime which is same as written on our IDE at coding time.
  • In c# it is used as per requirements in our programs.

Example:

// start class definition / declaration 
 class Program
 {
       // static main method void type declaration
        static void Main(string[] args)
        {
            Console.WriteLine(@"This is verbatim literal string data
                              I am at new line....
                              C# is an ""Object oriented programming language""");

            Console.WriteLine(@"following data is using tab without use of escape sequences
                                PHP            Asp.net            C#            Css
                                WordPress      Visual studio");

            Console.ReadKey();
        }   // End of main method definition
 }          // End of class definition





Next Tutorial →


← Previous Tutorial


Posted in: C# Basics, C#.NET

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .