Eclipse 格式化程序拆分长字符串
Posted
技术标签:
【中文标题】Eclipse 格式化程序拆分长字符串【英文标题】:Eclipse formatter split long String 【发布时间】:2015-12-10 05:46:15 【问题描述】:有没有办法告诉 Eclipse 格式化程序,当字符串太长时,它应该用+
分割它以适应最大线宽自动?
例如,如果我的最大线宽是 80,我会这样:
String s = "This is a very very very very very very very very very very very very very very very very very very very long String";
变成这样:
String s = "This is a very very very very very very very very very very very"
+ " very very very very very very very very long String";
【问题讨论】:
看看这个***.com/a/5398814/2551236 @Vihar 是的,我知道(实际上我的线宽是 100),但你只是在避免这个问题。如果我有一条 102 长的行,或者在那个帖子的情况下是 183 行怎么办? 【参考方案1】:没有。这意味着更改您的源代码,而不仅仅是空格。
【讨论】:
以上是关于Eclipse 格式化程序拆分长字符串的主要内容,如果未能解决你的问题,请参考以下文章