Print string: Difference between revisions
Jump to navigation
Jump to search
m (link to Random content generator) |
m (→PHP) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 6: | Line 6: | ||
<pre> | <pre> | ||
<?php | <?php | ||
echo <<<'EOD' | echo <<<'EOD' | ||
The quick brown fox jumps over the lazy dog | The quick brown fox jumps over the lazy dog | ||
| Line 11: | Line 12: | ||
e.g. \\ and \'. | e.g. \\ and \'. | ||
EOD; | EOD; | ||
</pre> | </pre> | ||
| Line 29: | Line 31: | ||
[[Category:Programming]] | [[Category:Programming]] | ||
[[Category:String manipulation]] | |||
Latest revision as of 17:42, 9 May 2022
Print the string spanning multiple lines
PHP[edit]
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[edit]
Using triple quotes[2] to print the string spanning multiple lines
print("""The quick brown fox
jumps over the lazy dog""")