Last active
April 27, 2019 09:36
-
-
Save Nirma/c3a7264788a6e6d69e5f890deb78faa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let example: Int = 42 | |
"This is a conventional string with interpolation: \(example)" | |
#"This is a raw string with interpolation: \#(example)"# | |
##"This is a string with raw pound signs with interpolation \##(example)"## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##"This string does not need to escape # since it uses double sharps"## | |
// Conventional String literals | |
"In conventional string literals \"quotes\" and backslashes like \\ must be escaped" | |
// Raw String literal | |
#" In a raw string literal anything goes \u{2029} \n does not trigger a line break "Even double quotes" "# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#""" | |
This is totally a multi-lined string | |
no need to escape stuff like " or \n or \u{2028} | |
and string interpolation still works too: \#(2 + 2) is 5 | |
"""# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment