首页 > 问答 > 正文
Stream.of("1","2","3","4")这个是输入我想得到1,2,3,4的输出,怎么写?
天蓬老师2017-04-18 10:09:53
用reduce
Stream.of("1","2","3","4").reduce((a,b) -> a +"," +b))
伊谢尔伦2017-04-18 10:09:53
如果你和我一样不懂reduce事干啥的话
String.join(",", stringStream.collect(Collectors.toList()));
转变思维有点难啊
高洛峰2017-04-18 10:09:53
雷雷