在Eclipse中粘贴多行Java字符串 [英] Paste a multi-line Java String in Eclipse
问题描述
String x =CREATE TABLE TEST(\\\
+A INTEGER NOT NULL PRIMARY KEY,\\\
...
使用Eclipse将多行字符串从剪贴板粘贴到Java源中(以自动创建如上所述的代码)的最快方式是什么?
好的,我刚刚找到答案< a>(在Stackoverflow,不少于)。
Eclipse有一个选项,以便将多行文本复制粘贴到字符串文字中将导致引用的换行符: p>
首选项/ Java / Editor / Typing /粘贴到字符串文字时转义文本
Unfortunately, Java has no syntax for multi-line string literals. No problem if the IDE makes it easy to work with constructs like
String x = "CREATE TABLE TEST ( \n"
+ "A INTEGER NOT NULL PRIMARY KEY, \n"
...
What is the fastest way to paste a multi-line String from the clipboard into Java source using Eclipse (in a way that it automatically creates code like the above).
Okay, I just found the answer (on Stackoverflow, no less).
Eclipse has an option so that copy-paste of multi-line text into String literals will result in quoted newlines:
Preferences/Java/Editor/Typing/ "Escape text when pasting into a string literal"
这篇关于在Eclipse中粘贴多行Java字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!