当然,这三种操作符(单引号、双引号和反撇号)都有合法的用途,但是与英语中的例外一样,记住和掌握这些细微差异很令人头疼。
Certainly, all three operators-the single, double, and back quotation marks-serve a valid purpose, but like exceptions in English, memorizing and mastering the variations can be maddening.
该函数使用一个正则表达式将一个单引号标记更改为带有反斜杠的单引号标记。
That function USES a regular expression to change a single quotation mark into backslashed single quotation mark.
您还可以简单地将整个字符串放到单引号(')中,但是需要在变量中真正的单引号字符前面加上一个反斜线(\ ')。
You can also simply enclose the entire variable value in single quotation marks (') as long as you precede any actual single quotation marks in the variable with a backslash (\ ').
所以,如果我想用单引号编码O'Reilly,我就必须使用反斜杠对它进行转义:'O\'Reilly'。
So, if I want to encode O'Reilly in a single quoted string, I must escape it using backslash, 'O\'Reilly'.
在MySQL中,字符序列\表示一个反斜杠转移单引号',但在DB 2中,单引号必须要再加一个单引号来实现转义' '(即两个单引号)。
The character sequence \ represents a backslash escaped single quote 'in MySQL, but in DB2, a single quote must be escaped by adding another single quote "(double single quotes)."
在行末使用一个单独的反斜杠字符,长的双引号或单引号文本可以被打断跨过多行。像这样。
The backslash, the newline, and all leading whitespace on the next line is removed, resulting in "This is a long text string".
在行末使用一个单独的反斜杠字符,长的双引号或单引号文本可以被打断跨过多行。像这样。
The backslash, the newline, and all leading whitespace on the next line is removed, resulting in "This is a long text string".
应用推荐