Special characters can be included in string literals using the following escape sequences:
The following example shows how to use a few string literals:

Swift 4

Escape sequence Meaning
\0 Null Character
\\ \character
\b Backspace
\f Form feed
\n Newline
\r Carriage return
\t Horizontal tab
\v Vertical tab
\’ Single Quote
\” Double Quote
\000 Octal number of one to three digits
\xhh… Hexadecimal number of one or more digits
 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

 

 

Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.