Interview

String type C#

Verbatim Literal is a string with an @ symbol prefix, as in @“Hello”. Verbatim literals make escape sequences translate as normal printable characters to enhance readability.

Practical Example: 
Without Verbatim Literal : “C:\\Pragim\\DotNet\\Training\\Csharp”; // Less Readable
With Verbatim Literal : @”C:\Pragim\DotNet\Training\Csharp”; // Better Readable

C# example program used in the demo

using System; namespace ConsoleApplication1  {   

  class Program     {   

      public static void Main()         {     

        // Displaying double quotes in c#       

      string Name = “\”Pragim\””;       

      Console.WriteLine(Name);
            // Displaying new line character in c#     

        Name = “One\nTwo\nThree”;       

      Console.WriteLine(Name);
            // Displaying new line character in c#     

        Name = “c:\\Pragim\\DotNet\\Training\\Csharp”;             Console.WriteLine(Name);
            // C# verbatim literal        

     Name = @”c:\Pragim\DotNet\Training\Csharp”;             Console.WriteLine(Name);    

     }    

} }

About the author

Avatar of shohal

shohal

I have profession and personal attachment with custom ERP Software development, Business Analysis, Project Management and Implementation almost (36) ,also Oracle Apex is my all-time favorite platform to developed the software. Moreover i have some website development experience with WordPress. For hand on networking experience DevOps and CCNA, it create me a full package. Here are some core programming language with networking course i have been worked: Oracle SQL ,PL/SQL,Oracle 19c Database , Oracle Apex 20.1,WordPress,Asp.Net ,MS SQL ,CCNA ,Dev Ops, SAP SD

Leave a Comment