private String getCriterion(List specificRegularList, int type) {\n\n StringBuilder stringBuilder = new StringBuilder();\n int count = 0;\n int size = specificRegularList.size();\n for (SpecificRegular specificRegular : specificRegularList) {\n //找到当前项目(倒车入库)的所有具体规则,排除不扣分具体规则\n if (specificRegular.getProjectId() == type && specificRegular.getDemeritState() != 0) {\n stringBuilder.append(++count).append(".").append(specificRegular.getVoiceBroadcastText()).append(",扣").append(specificRegular.getDemeritState()).append("分。");\n if (count != size) {\n stringBuilder.append("\n");\n }\n }\n }\n return stringBuilder.toString();\n }

Java代码优化:拼接语句并自动换行

原文地址: https://www.cveoy.top/t/topic/qfQd 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录