Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StringBuilder contentBuilder = new StringBuilder();
- try (Stream<String> stream = Files.lines(Paths.get("test.txt"), StandardCharsets.UTF_8)) {
- stream.forEach(s -> contentBuilder.append(s).append("\n"));
- }
- System.out.println(contentBuilder);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement