Maybe this is not what you mean but…
If I’m on a line in Eclipse and I enter double quotation marks, then inside that paste a multiline selection (like your xyz example) it will paste out like this:
"xxxx\n" +
"yyyy\n" +
"zzz"
Then you could just find/replace in a selection for "\n"
to ""
, if you didn’t intend the newlines.
I think the option to enable this is in Window/Preferences
, under Java/Editor/Typing/
, check the box next to "Escape text when pasting into a string literal"
. (Eclipse 3.4 Ganymede
)