Show/Hide Toolbars

XSharp

There are different notations for a char literal, depending on the dialect selected.
In many dialects, the single quotes are string delimiters, and therefore, the 'c' prefix is needed for character literals.

Only in the Core and Vulcan dialects, single quotes are always reserved for character literals.

 

Literal

VO, XPP, FoxPro & Harbour

Vulcan & Core

c'<char>' or c"<char>"

Char literal*

Char literal*

'<char>'

String literal

Char literal*

 

The <char> literals in the table that are marked with an asterisk (*) may contain a special escape code:

 

Character

Description

Character that does NOT start with a backslash

Normal character

\\

Backslash

\"

Double quote

\'

Single quote

\0

0 character

\a

Alert

\b

Backspace

\f

Form feed

\n

Line feed

\r

New Line

\t

Tab

\v

Vertical tab

\x HEXDIGIT(1-4)

Hex number of character. 1-4 hex digits.

\u HEXGDIGIT (4 or 8)

Unicode number of character. 4 or 8 hex digits.