C# Source Code: Character literals
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
C# Source Code
Character literals
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Tuesday, April 06, 2004
Hits:
561
Category:
General/Framework
Article:
The table below gives commonly used character literals using a simple escape sequences to represent Unicode character encoding: Escape sequence Character name Unicode encoding \' Single quote 0x0027 \" Double quote 0x0022 \\ Backslash 0x005C \0 Null 0x0000 \a Alert 0x0007 \b Backspace 0x0008 \f Form feed 0x000C \n New line 0x000A \r Carriage return 0x000D \t Horizontal tab 0x0009 \v Vertical tab 0x000B The table below gives commonly used character literals using a simple escape sequences to represent Unicode character encoding: Escape sequence Character name Unicode encoding \' Single quote 0x0027 \" Double quote 0x0022 \\ Backslash 0x005C \0 Null 0x0000 \a Alert 0x0007 \b Backspace 0x0008 \f Form feed 0x000C \n New line 0x000A \r Carriage return 0x000D \t Horizontal tab 0x0009 \v Vertical tab 0x000B Below are a few examples: string a = "Hello, Andrew"; // Hello, Andrew string b = @"Hello, Andrew"; // Hello, Andrew string c = "hello \t world"; // hello world string d = @"hello \t world"; // hello \t world string e = "Andrew says \"relax\"!"; // Andrew says "Relax"! string f = @"Joe said ""Hello"" to me"; // Andrew says "Relax"! string g = "\\\\server\\directory\\myapp.exe";// \\server\directory\myapp.exe string h = @"\\server\directory\myapp.exe"; // \\server\directory\myapp.exe string i = "Come\r\nOver\r\nHere"; \* Come Over Here */
Terms and Conditions
Support this site
Download a trial version of the best FTP application on the internet