(String[] args)
| 7 | |
| 8 | public class ListOfLines { |
| 9 | public static void |
| 10 | main(String[] args) throws Exception { |
| 11 | Files.readAllLines( |
| 12 | Paths.get("../streams/Cheese.dat")) |
| 13 | .stream() |
| 14 | .filter(line -> !line.startsWith("//")) |
| 15 | .map(line -> |
| 16 | line.substring(0, line.length()/2)) |
| 17 | .forEach(System.out::println); |
| 18 | } |
| 19 | } |
| 20 | /* Output: |
| 21 | Not much of a cheese |