什么是反斜杠字符 (\)? [英] What is the backslash character (\)?
本文介绍了什么是反斜杠字符 (\)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是字符串文字 \
反斜杠?它有什么作用?我想过,但我不明白.我还在 维基百科 上阅读了它.当我尝试打印以下内容时:
What is the string literal \
backslash? What does it do? I have thought about it but I do not understand it. I also read it on wikipedia. When I try to print the following:
System.out.println("Mango \ Nightangle");
输出为:Mango Nightangle
这个字符串字面量有什么意义?
What is the significance of this string literal?
推荐答案
在许多编程语言(包括 Java)中用作转义序列.
is used as for escape sequence in many programming languages, including Java.
如果你想
- 转到下一行然后使用
- 标签使用
- 同样要打印一个
或
"
,它们在字符串文字中是特殊的,你必须用另一个将它转义,它给我们
\
和"
- go to next line then use
- for tab use
- likewise to print a
or
"
which are special in string literal you have to escape it with anotherwhich gives us
\
and"
这篇关于什么是反斜杠字符 (\)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文