- Place the caret on the line, to which the other lines should be added.

- Sequentially press
Ctrl+Shift+JCommand Shift J
keyboard shortcut, until all
fragments are joined in a single line.


- Select the lines with string literals that should be joined.

- Press
Ctrl+Shift+JCommand Shift J
keyboard shortcut. All redundant characters
(spaces, quotes, and plus signs) are gone.

Examples
Joining a field or variable declaration and assignment:

Pressing Ctrl+Shift+JCommand Shift J produces the following result, with the unwanted spaces and variable name in the second line removed:

Consider the following pair of statements:

Press Ctrl+Shift+JCommand Shift J to join these lines into a correct single-line statement.


