You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function jabberwock()
"""
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
"""
end
julia> print(jabberwock())
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
The point of the """ construct is to make it easy to embed snippets of text or code in a readable, nice way inside of Julia code. To that end, it is similar to here documents as well as Python's multiline strings, which use the same delimiters. However, a couple of semantics make these easier to use:
If the initial """ is on a line followed only by whitespace, that whitespace (including newline) will be stripped.
Lines following the opening """ token must begin with the same indentation sequence (identical whitespace characters).
The common indentation will be stripped from each follow-up line.
After these transformations are applied, all normal string interpretation is performed. Moreover, you can prefix """ with an identifier as you can with " strings to invoke macro-based custom-string forms. Thus, a Q""" multiline string has no interpolation performed and a r""" is a multiline regex literal (should maybe automatically switch on some flags).
The text was updated successfully, but these errors were encountered:
Stolen from Python but with some differences:
The point of the
"""
construct is to make it easy to embed snippets of text or code in a readable, nice way inside of Julia code. To that end, it is similar to here documents as well as Python's multiline strings, which use the same delimiters. However, a couple of semantics make these easier to use:"""
is on a line followed only by whitespace, that whitespace (including newline) will be stripped."""
token must begin with the same indentation sequence (identical whitespace characters).After these transformations are applied, all normal string interpretation is performed. Moreover, you can prefix
"""
with an identifier as you can with"
strings to invoke macro-based custom-string forms. Thus, aQ"""
multiline string has no interpolation performed and ar"""
is a multiline regex literal (should maybe automatically switch on some flags).The text was updated successfully, but these errors were encountered: