Intellij-idea reverse paste into string (aka copy from string)?

Tags: , , ,



In Intellij idea if you paste some text into a string literal (between double quotes) the java editor can automatically reformat the pasted text – ie to place necessary escaping characters for double quotes new lines etc.
I want to do reverse, ie when copying text from inside a string literal the editor to place the clean text in the clipboard without the escaping characters, double quotes and new lines separated by plus signs etc.

For example when a paste these XML lines

<?xml version="1.0" encoding="utf-8"?>
<a></a>

into a string literal in Intellij Java editor it becomes:

String str = "<?xml version="1.0" encoding="utf-8"?>n" +
             "<a></a>"

I want when I copy from this string literal to have an option for storing the clean text in the clipboard as it was before pasting. Ie to have the original text back.

Answer

Place cursor at value of the string and followed by Alt + Enter | Copy String Concatenation Text to the Clipboard



Source: stackoverflow