IntellijIDEA supports Scala multi-line strings. Scala multi-line strings feature lets you format literals and helps your code to look more orderly.
Scala offers a method called stripMargin that removes the left-hand part of a multiline string up to a specified delimiter (default: "|").
To envoke stripMargin method, enter triple quots. Now you are able to enter multi-line strings.
It also preserves white spaces. Please see the following example:
You can choose different intention options for Scala multi-line strings. Place your cursor on the string and press
For examle, you can choose option Insert gap with concatenation. For the Scala version 2.10 and later you also have the ability to convert the inserted string into interpolated one.
Now you can convert to interpolated strings.
The result is as follows:
You can set a different format for multi-line strings options such as Margin char indent or Margin Char. You can also disable a multi-line strings support.