Literal Values

// Literal Values
// TYPE(S)                 CATEGORY    SUFFIX                            EXAMPLE/ALLOWED VALUES
// bool                    boolean     none                              true or false
// int, uint, long, ulong  integer     none                              100
// uint, ulong             integer     u or U                            100U
// long, ulong             integer     l or L                            100L
// ulong                   integer     ul, uL, Ul, UL, lu, lU, Lu, LU    100UL
// float                   real        f or F                            1.5F
// double                  real        none, d, D                        1.5
// decimal                 real        m or M                            1.5M
// char                    character   none                              'a', or escape sequence
// string                  string      none                              "a…a", may include escape sequences

 

Escape Sequences for String Literals

 

// ESCAPE SEQUENCE CHARACTER PRODUCED      UNICODE VALUE OF CHARACTER
// \'              Single quotation mark   0x0027
// \"              Double quotation mark   0x0022
// \\              Backslash               0x005C
// \0              Null                    0x0000
// \a              Alert (causes a beep)   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 Unicode Value of Character column of the preceding table shows the hexadecimal values of the
// -characters as they are found in the Unicode character set. As well as the preceding, you can specify any
// -Unicode character using a Unicode escape sequence. These consist of the standard \ character followed by a
// -u and a four-digit hexadecimal value
//
// -the following strings are equivalent:
// "Karli\'s string."
// "Karli\u0027s string."
//
// -strings are reference types,can be assigned the value null
//
//
// -verbatim string literals
// -the following strings are equivalent:
// "C:\\Temp\\MyDir\\MyFile.doc"
// @"C:\Temp\MyDir\MyFile.doc"

转载于:https://www.cnblogs.com/yoghourt/p/4044195.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值