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

Example from php:

$xml = <<<XML

Example from python:

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

Last updated June 22nd, 2020

Edit Multiline Strings on GitHub