代码如下
String[] words = new String[]{"Hello","World"}; List<String[]> a = Arrays.stream(words) .map(word -> word.split("")) .distinct() .collect(toList()); a.forEach(System.out::print);
Stream的运行流程如下
转载自:https://blog.csdn.net/liyantianmin/article/details/96178586