Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Files.lines(Paths.get(ReadFile.class.getResource(path).toURI()), StandardCharsets.UTF_8)
- .flatMap(s->Arrays.stream(s.split(" ")))
- .filter(s->!s.isEmpty())
- .collect(Collectors.toList());
- List<List<String>> list = Files.lines(Paths.get(ReadFile.class.getResource(path).toURI()), StandardCharsets.UTF_8)
- .map(s -> Arrays.asList(s.split(" ")))
- .collect(Collectors.toList());
- System.out.println(list);
Add Comment
Please, Sign In to add comment