Multiline Strings is an actively used design pattern. Some languages allow strings to span multiple lines.
- 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
Example from ion:
( '''hello ''' // Sexp with one element '''world!''' ) ("hello world!") // The exact same sexp value // This Ion value is a string containing three newlines. The serialized // form's first newline is escaped into nothingness. '''\ The first line of the string. This is the second line of the string, and this is the third line. '''
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 August 9th, 2020