Eclipse快捷键拆分长字符串 [英] Eclipse Shortcut to Split Long Strings

查看:139
本文介绍了Eclipse快捷键拆分长字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我发现我看到有人这样做,但是我找不到各种快捷方式列表。
$ b

  String s =很长......................... ...字符串; 

是否有Eclipse快捷方式将其转换为:

  String s =A long long ............................
+String;


解决方案

Yup - 当你的光标在



诚然,将+放在第一行的末尾,而不是第二行的开头,如果您的风格指南要求后者,但如果你不是很笨,那很棒:)


I swear I've seen someone do this, but I can't find it in the various lists of shortcuts.

Given:

String s = "A very long ............................ String";

Is there an Eclipse shortcut to turn it into:

String s = "A very long ............................ " 
    + "String";

解决方案

Yup - just hit return when your cursor is in the middle of the string.

Admittedly that puts the + at the end of the first line instead of the start of the second, which is irritating if your style guide demands the latter, but if you're not fussy it's great :)

这篇关于Eclipse快捷键拆分长字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆