Join Us!

Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.
A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Login

Enter your Project Envision username.
Enter the password that accompanies your username.
Request new password

Special characters in C#

There are some characters in .NET that were labeled special. For example how would we represent a single quote in a string or a tabulator? We would use escape character, which is backspace (\). Escaping character just means putting backspace in front of special character. Below program shows this concept in more detail.

using System;

namespace SpecialCharacters
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("single quote: \'");
            Console.WriteLine("quotation mark: \"");
            Console.WriteLine("backslash: \\");
            Console.WriteLine("alert: \a");
            Console.WriteLine("backspace: -\b");
            Console.WriteLine("form feed: \f");
            Console.WriteLine("newline: \n");
            Console.WriteLine("carriage return: \r");
            Console.WriteLine("tabulator: \tKrystian");
            Console.WriteLine("vertical quote: \vKrystian");
            Console.WriteLine("unicode character 0: \0");
            Console.WriteLine("4B in hex is equal 75 in decimal, which represents letter K in ASCII");
            Console.WriteLine("unicode hex: \u004B");
            Console.WriteLine("hex: \x4B");
            Console.ReadLine();

        }
    }
}
Categories: