I want to got a List of List instead of List of Array in the below code:
List<String[]> list = org.simpleflatmapper.csv.CsvParser.reader(in).stream().collect(Collectors.toList());
How can we got List<List<String>> list =
... ?
答案 0 :(得分:2)
you need to map String[] to List
List<List<String>> list = org.simpleflatmapper.csv.CsvParser.reader(in).stream()
.map(Arrays::asList)
.collect(Collectors.toList());
答案 1 :(得分:1)
org.simpleflatmapper.csv.CsvParser.reader(in).stream()
.map(Arrays::asList)
.collect(Collectors.toList());