且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java中的所有转义字符是什么?

更新时间:2023-01-14 19:35:22

你可以找到完整的列表 here




  • \t 此时在文本中插入选项卡。

  • \b 此时在文本中插入退格。

  • \\\
    插入换行符在这一点上的文本中。

  • \r 此时在文本中插入回车。

  • \f 此时在文本中插入换页。

  • \\'此时在文字中插入单引号。

  • \此时在文本中插入一个双引号字符。

  • \\ 在此时的文字。


I know some of the escape characters in Java, e.g.

\n : Newline
\r : Carriage return
\t : Tab
\\ : Backslash
...

Is there a complete list somewhere?

You can find the full list here.

  • \t Insert a tab in the text at this point.
  • \b Insert a backspace in the text at this point.
  • \n Insert a newline in the text at this point.
  • \r Insert a carriage return in the text at this point.
  • \f Insert a formfeed in the text at this point.
  • \' Insert a single quote character in the text at this point.
  • \" Insert a double quote character in the text at this point.
  • \\ Insert a backslash character in the text at this point.