首頁 > 問答 > 主體
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
雷雷