发信人: deepbeep (咪咪豆), 信区: Programming
标 题: Re: expression in Java
发信站: Unknown Space - 未名空间 (Thu Mar 17 22:00:11 2005), 转信
Because Unicode escapes are processed very early, it is not correct to
write '\u000a' for a character literal whose value is linefeed (LF); the
Unicode escape \u000a is transformed into an actual linefeed in translation
step 1 (§3.3) and the linefeed becomes a LineTerminator in step 2 (§3.4),
and so the character literal is not valid in step 3. Instead, one should
use the escape sequence '\n' (§3.10.6). Similarly, it is not correct to
write '\u000d' for a character literal whose value is carriage return (CR).
Instead, use '\r'.
【 在 scififi (What are you looking at?) 的大作中提到: 】 : String b = "\u000A"; is syntax error.
: String b = "\u0009"; is right,
: String b = "\u001A"; is right too.
: How to input "\u000A" into a variable?
※ 来源:．Unknown Space - 未名空间 mitbbs.com．[FROM: 69.22.]