According to the following question and response:
How find out static string result concatenation in Intellij Idea without running code?
it is possible to copy result of the String concatenation from IntelliJ into the clipboard.
Let me cite:
just put cursor on the string concatenation Press alt + enter Select "Copy String concatenation text into clipboard" Paste result somewhere.
However, I find out that this solution does not work in case of the String.format.
Is there any workaround or plugin for the IntelliJ that allows to perform this operation?
public class Main {
public static void main(String[] args) {
final String one = "want";
final String two = "copy";
final String three = "concatenated string";
// I want to copy whole concatenated string
String canBeCopiedIntoClipBoard = "I " + one + " to " + two + " whole " + three;
String cannotCopyResultIntoClipBoard = String.format("I %s to %s whole %s", one, two, three);
assert canBeCopiedIntoClipBoard.equals(cannotCopyResultIntoClipBoard);
System.out.println(canBeCopiedIntoClipBoard);
}
}