StringBuilder sb = new StringBuilder(); for(String s strArr) { if (sb.length() > 0) {//该步即不会第一位有逗号,也防止最后一位拼接逗号! sb.append(","); } sb.append(s); } System.out.println(sb.toString());