Multiline Strings is an actively used design pattern. Some languages allow strings to span multiple lines.

?Years Old
  • Have a question about Multiline Strings not answered here? Email me and let me know how I can help.

Languages without Multiline Strings include json

Languages with Multiline Strings include javascript, php, python, ruby

Example from javascript:

const lines = `one
two`

Example from php:

$xml = <<<XML
l
vv
XML;

Example from python:

template = """This is the first line.
This is the second line.
This is the third line."""

Last updated January 24th, 2020

Edit Multiline Strings on GitHub