Print string: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
(Created page with "Print the string spanning multiple lines == PHP == Using the Heredoc syntax<ref>[https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc...")
 
m (link to Random content generator)
Line 20: Line 20:
jumps over the lazy dog""")
jumps over the lazy dog""")
</pre>
</pre>
== Related pages ==
* [[Random content generator]]


== References ==
== References ==

Revision as of 17:41, 9 May 2022

Print the string spanning multiple lines

PHP

Using the Heredoc syntax[1] to print the string spanning multiple lines

<?php
echo <<<'EOD'
The quick brown fox jumps over the lazy dog
using nowdoc syntax. Backslashes are always treated literally,
e.g. \\ and \'.
EOD;

Python

Using triple quotes[2] to print the string spanning multiple lines

print("""The quick brown fox 
jumps over the lazy dog""")

Related pages

References