特殊字符
在双引号字符串中使用时,转义字符(反引号`
)会重复出现一个特殊字符。
`0 #Null
`a #Alert/Beep
`b #Backspace
`f #Form feed (used for printer output)
`n #New line
`r #Carriage return
`t #Horizontal tab
`v #Vertical tab (used for printer output)
例:
> "This`tuses`ttab`r`nThis is on a second line"
This uses tab
This is on a second line
你还可以转义具有特殊含义的特殊字符:
`# #Comment-operator
`$ #Variable operator
`` #Escape character
`' #Single quote
`" #Double quote