Pages

Sunday, March 27, 2011

Example of Escape Sequence in C#.Net:

Here is illustration program, you can find the result by run it !




using System;


namespace tryNew
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("this is use of single quotation mark " + "\'in quotation\'");
            Console.Write("\n");
            Console.Write("this is use of double quotation mark " + "\"in quotation\"");
            Console.Write("\n");
            Console.Write("this is use of Backslash " + "\\ with backslash");
            Console.Write("\n");
            Console.Write("this is use of Backspace " + "---\b with backspace");
            Console.Write("\n");
            Console.Write("this is use of From feed " + "\f with From feed");
            Console.Write("\n");
            Console.Write("this is use of Tab charracter " + "\t with Tab charracter");

            Console.Write("\n");
            string mywords = @"'this is the example which shows that how to avoid escape sequences'";
            Console.Write("this is use of @ to avoid escape sequences  " + mywords);
            Console.Write("\n");
            Console.Write("press Enter to exit");
            Console.Read();


        }
    }
}

No comments:

Post a Comment