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(); } } }
Recent comments
1 year 44 weeks ago