PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Multiline Strings

Multiline Strings

Multiline Strings are a feature.

Some languages allow strings to span multiple lines.


Languages without Multiline Strings include JSON

Languages with Multiline Strings include JavaScript, Python, PHP, Ruby, Elixir, Ion, Boron

Example from JavaScript:
const lines = `one two`
Example from Python:
template = """This is the first line. This is the second line. This is the third line."""
Example from PHP:
$xml = <<<XML l vv XML;
Example from Elixir:
template = """ This is the first line. This is the second line. This is the third line. """
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. '''
Example from Boron:
{{ Line 1 Line 2 }}
letter-first-identifiers-feature.html 路 multiline-strings-feature.html 路 namespace-feature.html

View source

PLDB - Build the next great programming language 路 v2022 Day 33 Docs Build Acknowledgements Traffic Today Traffic Trends Mirrors GitHub feedback@pldb.com