IntelliJ IDEA 2016.2 Help

Working with Strings in Scala

IntelliJ IDEA lets you add different intentions for strings and perform different actions with strings in Scala.
IntelliJ IDEA also supports the Scala multi-line strings feature. This feature lets you format literals and helps your code to look more orderly.

Converting a String into a Multi-line String and Vice Versa

You also can convert the multi-line string into the regular string.
Press Alt + Enter to open the drop-down list of intentions. Select Convert to "string" and press Enter.
View the result.

To start entering a multi-line string, simply type triple quotes in your editor.
If you press Enter, it will automatically invoke stripMargin method.
The stripMargin method removes the left-hand part of a multi-line string up to a specified delimiter.
The white spaces are also preserved. Please see the following example:

Inserting a Replace Intention

The replace("\r"," ") intention lets you keep the caret in the correct place on the next line in the multi-line strings regardless
of what operating system you have at the moment.