Java读取文件内容为String字符串
Java读取文件内容为String字符串
String content = new String(Files.readAllBytes(Paths.get("sample.txt")));
或
List<String> content = Files.readAllLines(Paths.get("sample.txt"))
Loading...
String content = new String(Files.readAllBytes(Paths.get("sample.txt")));
或
List<String> content = Files.readAllLines(Paths.get("sample.txt"))