IDEA 換行符+號在行開頭
1.前言
當我們拷貝一段字符時,每當換行的時候爲了結構美觀便於查看信息我們希望換行符能夠在每行的開頭。只需要在IDEA中修改設置即可。
2.修改設置
2.1.對比修改前後效果
2.1.1.修改設置前
- 換行符+號位置不固定結構混亂不方便查看字符串內容
public static void getString(String str) {
String classStringFormat = "package com.bruce;\n" +
"\n" +
"/**\n" +
" * @author bruce\n" +
" */\n" +
"public class Str extends AbstractStr{\n" +
"\n" +
" protected Str() {\n" +
" super(\"user\", \"users\");\n" +
" }\n" +
"}";
}
2.1.2. 修改設置後
- 換行符+號位置固定在每行開頭 結構整潔有序方便查看字符串內容
public static void getString(String str) {
String classStringFormat = "package com.bruce;\n"
+ "\n"
+ "/**\n"
+ " * @author bruce\n"
+ " */\n"
+ "public class Str extends AbstractStr{\n"
+ "\n"
+ " protected Str() {\n"
+ " super(\"user\", \"users\");\n"
+ " }\n"
+ "}";
}