PHP中文网2017-04-18 10:55:31
C#的話:
var flat = list.SelectMany(l=>l).ToList();
Java的話:
List<model> flat = list.stream().flatMap(List::stream).collect(Collectors.toList());
高洛峰2017-04-18 10:55:31
list.stream().flatMap(model-> model.stream()).forEach(System.out::println);