String Escape Sequences Flashcards
'
put a single quote mark in a string (‘)
print” he's clever!”
he’s clever
\
to put a blackslash in a string ()
"
allows double quote marks in string (“)
print “"your so silly" he said.”
“your so silly” he said.
\a
sounds an audio beep
ASCII bell (BEL)
\b
ASCII backspace (BS)
print “every \bday”
everyday
\f
ASCII formfeed (FF) indent new line print "every \fday
every
day
\n
ASCII linefeed
new line
print “every /nday”
every
day
\N{name}
returns character named name from unicode database (unicode only)
\r
carriage return (CR) in ASCII starts at beginning of line again can overwrite
print”every bloody \rday
dayry bloody
\t
horizontal tab (TAB) in ASCII indent (tab) forwards
print “every bloody \tday”
every bloody day
\uxxxx
returns character with 16-bit hex value xxxx (unicode only)
\uxxxxxxxx
returns character with 32-bit hex value xxxxxxxx (unicode only
\v
ASCII vertical tab
return new line at end point of previous line
print “every bloody \vday”
every bloody
day
\ooo
returns character with octal value ooo
\xhh
returns character with hex value hh