Saturday, December 30, 2017

What are escape sequences in C# ?


Escape sequences are special characters which are created by combination of characters consisting of backslash (\) followed by a letter of a combination of digits.

An escape sequence is considered as a single character since there is no letter or character that textually represents the escaped character. Backslash (\) in a string indicates that character following it is a special character or should be interpreted literally.


List of C# escape sequences:

·         \'   -        Single Quotation mark
·         \"   -        Double Quotation mark
·         \\  -        Backslash for file path
·         \?  -        Question Mark
·         \a  -        Alert (bell character)
·         \b  -        Backspace
·         \f   -        Form feed
·         \n  -        New line
·         \r  -        Carriage return
·         \t  -        Horizontal tab
·         \v  -        Vertical tab
·         \e  -        Escape
·         \0  -        Null
·         \u  -        ASCII character hex value escape sequence
·         \x  -        ASCII character hexadecimal escape sequence
·         \o  -        ASCII character octal notation


Share This
Previous Post
Next Post

TekGrabs, established in 2017, is in the business of sharing Information. It provides news, articles and photos about the different technologies, inventions in different domains. Provides information on programming and databases.

0 comments: