Builtin string types in C sharp Arabic #03

 



Part 03 - C# Tutorial - String type

Suggested Videos
Part 00 - Introduction to C#
Part 01 - Reading and writing to console
Part 02 - Built-in types

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);
        }
    }
}


Follow Us

YouTube

 If you want to download pptx : click Telegram

Facebook

Twitter

Instagram

Tik Tok


إرسال تعليق

أحدث أقدم