Reputation: 36634
Is there a way to paste a multiline string in the NetBeans IDE and have it automatically converted to a string literal (with " escaped to \"), similar to the Eclipse option?
This can be very helpful for example to insert SQL source code.
See also: Paste a multi-line Java String in Eclipse
Upvotes: 4
Views: 3116
Reputation: 56
Netbeans have this function within.
Type: String myString = "
Then paste your code and it will be formatted =)
Upvotes: 3
Reputation: 36634
There is a plugin for this: Java Text Copy Paste Module
Helps copy and paste text from and to Java source code by converting the text back and fourth between Java source and the original text format such as SQL, XML, or HTML. It ties into the system clipboard, so all one has to do is copy text in their favorite SQL or XML editor then use the "Java Text Copy Paste Module" specific actions to transform the code. Code can also be highlighted in the Java editor and copied using the "Java Text Copy Paste Module" specific actions to transform it back into the original text format for pasting into their favorite utility editor. Works great with SQL and XML editors.
Upvotes: 1