java 中的空格符、换行符等怎么表示

特殊字符的表示方法::

1、\t 空格 ('\u0009')

2、\n 换行 ('\u000A')

3、\\ 反斜杠

4、\r 回车 ('\u000D')

5、\d 数字等价于[0-9]

6、\D 非数字等价于[^0-9]

7、\s 空白符号 [\t\n\x0B\f\r]

8、\S 非空白符号 [^\t\n\x0B\f\r]

9、\w 单独字符 [a-zA-Z_0-9]

10、\W 非单独字符 [^a-zA-Z_0-9]

11、\f 换页符

12、\e Escape

猜你喜欢

转载自blog.csdn.net/xiansibao/article/details/127789274