📅  最后修改于: 2022-03-11 14:52:10.887000             🧑  作者: Mango
List result = Arrays.asList("Java", "Stream", null, "Filter", null);
result.stream().filter(str -> str != null).forEach(System.out::println)
// OR
Stream result = Stream.of("java", null, "python", "devops", null);
result.filter(str -> str != null).forEach(System.out::println)