The backslash escape character turns special characters into string characters:
var x = 'It\'s alright';
str1 = 'I\'m a string.; str2 = "I'm a string.";
str2output the same string but
str2is easier to read since it doesn’t require an escape character in
[…]you escape double-quotes and single-quotes so Python knows to include in the string. Here’s an example:
"I am 6'2" tall." # escape double-quote inside string 'I am 6\'2" tall.' # escape single-quote inside string
When the apostrophe/single quote is in the middle of the string, you need to enter single quotes for Oracle to display a quote symbol. For example:
SELECT 'He''s always the first to arrive'
(This could go on.)
The examples aren’t perfect, the sources, neither, but what’s wrong in this picture?
(On macOS with US keyboard layout you should be able to type a apostrophe through option + shift + ]. On Windows, use something like alt + 0146.)
Yes, we’ll still need to escape characters—perhaps the examples simply aren’t great—and tutorials to say how to. But through proper punctuation do our designs benefit, as well as our code.
If you have a question or suggestion about what I write, please leave a comment or a message.
Have a look at the most popular posts, possibly including:
Perhaps my most relevant book: CSS Optimization Basics (2018). Writing CSS is a craft. As craftspeople we strive to write high quality CSS. In CSS Optimization Basics I lay out some of the most important aspects of such CSS. (Also available in a bundle with Upgrade Your HTML and The Web Development Glossary.)
Looking for a way to comment? Comments have been disabled, unfortunately.