StringJoiner 是 java 1.8 后 util 包新增的格式化字符串的工具类
StringJoiner joiner = new StringJoiner(",", "gg-", "-gg");
System.out.println(joiner.add("11").add("22").add("33"));
打印结果
StringJoiner 是 java 1.8 后 util 包新增的格式化字符串的工具类
StringJoiner joiner = new StringJoiner(",", "gg-", "-gg");
System.out.println(joiner.add("11").add("22").add("33"));
打印结果