9.6 The char type


9.6 The char type

Like Java, a char in C# is a 16-bit Unicode character instead of the traditional 8-bit ASCII character of older programming languages. Table 9.5 shows escape the sequences supported by C# which can be used in character assignments or within string literals.

Table 9.5. Escape sequences for characters and strings

Escape sequence

Character represented

Comments

\'

single quote

Same as in Java

\"

double quote

\\

backslash

\0

null

\a

alert (beep sound)

No such escape sequence in Java “ For example, System.Console.WriteLine("\a "); causes a beep.

\b

backspace

Same as in Java

\f

form feed

\n

new line

\r

carriage return

\t

horizontal tab

\v

vertical tab

No such escape sequence in Java



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net