簡體   English   中英

Eclipse,將if語句格式化為一行語句

[英]Eclipse, format if statements to one line statement

有沒有辦法創建一個更改的自動格式化程序:

if (foo.length > 1)
   bar = foo[1];
else
    bar = "";

bar = (foo.length > 1) ? foo[1] : ""; 

如何讓shift+ctrl+f自動組織這個?

此插件專門用於將if-else塊更改為三元運算符。

https://marketplace.eclipse.org/content/spartan-refactoring-0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM