Eclipse shortcut for splitting long strings

I swear I saw someone doing this, but I can’t find it in the various shortcut lists.

Given:

String s = "A very long ............................ String";

Is there an Eclipse shortcut to enable it:

String s = "A very long ............................ " 
    + "String";
+5
source share
4 answers

Yup - just hit return when your cursor is in the middle of the line.

Admittedly, this puts + at the end of the first line instead of the beginning of the second, which is annoying if your leadership style requires the latter, but if you're not fussy, this is great :)

+13
source

Eclipse ( ), , - .

+1

Quick Fix (Ctrl + 1).

3.4, , , + StringBuilder MessageFormat. Brilliant!

0

, . , Ctrl + F :

: "\s*?\+\s*?\R(\s*?)"

: "\R$1\+ "

0

All Articles