SIP-XX: Dedented Multiline String Literals

Yes, we can! There are a few options, define that the string is closed only by a

  • single-quote as only character on a line. So all other single-quote are interpreted as quotes in the string
  • single-quote directly followed by an EOL character directly (then you must only escape this special case, if it occurs which is seldom)
  • a tripple quote.

The latter combination would look like this:

val json = "
  {
    "one": 1,
    "two": 2
  }"""

and has the advantage we do not need to introduce other characters like ’ ’ ’ to define a string. Feels more natural!