我们先来看看别人是怎么说转义字符的?
这是我随便从两本书上截图来的,总的来说就是反斜杠加几个字符就是转义字符。
就问你晕不晕,斜杠加几个字符至少是两个字符,那还叫字符吗,那叫字符串吧,怎么取名转义字符?
于是我找外文是怎么说的。下图就是我找的外文:
然后我摘了几句如下:
In our greeting string, we can see the \ndigraph, which represents the <newline> character to be output to the console.
从上面可以看出\n叫digraph。
Digraphs that appear in strings are also called escape sequences。
从上面可以看出digraph叫转义字符序列。
Even though escape sequences appear as two characters, they are actually a single, non-visible character.
从上面可以看出转义序列以两个字符形式出现。
通过以上分析我们所说的转义字符其实叫转义字符序列,这样就通了。