Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

IntellijIDEA supports Scala multi-line strings. Scala multi-line strings lets you format literals that help 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: "|").

Entering Multi-line strings

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:


Selecting Intentions for Scala Multi-line Strings

You can choose different intention options for Scala multi-line strings. Place your cursor on the string and press [span:class=shortcut}Alt+ Enter.

For example, if you select Convert to "String" option, you will see the following result:

The multi-line string is converted to the one-line string.

Formatting Multi-line Strings Options

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.

 

  • No labels