Guest User

Untitled

a guest
Apr 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Files.lines(Paths.get(ReadFile.class.getResource(path).toURI()), StandardCharsets.UTF_8)
  2. .flatMap(s->Arrays.stream(s.split(" ")))
  3. .filter(s->!s.isEmpty())
  4. .collect(Collectors.toList());
  5.  
  6. List<List<String>> list = Files.lines(Paths.get(ReadFile.class.getResource(path).toURI()), StandardCharsets.UTF_8)
  7. .map(s -> Arrays.asList(s.split(" ")))
  8. .collect(Collectors.toList());
  9.  
  10. System.out.println(list);
Add Comment
Please, Sign In to add comment