伊谢尔伦2017-04-18 10:09:53
If you are like me and don’t understand what reduce does
String.join(",", stringStream.collect(Collectors.toList()));
It’s a bit difficult to change your thinking
高洛峰2017-04-18 10:09:53
Stream.of(1, 2, 3, 4).reduce(new StringBuilder(), (sb, s) -> sb.append(s).append(','), StringBuilder::append).toString();