FileUtils从Commons IO使用:
String[] files = { "file1.txt", "file2.txt", "file3.txt" };for (String file : files) { File f = new File(file); String content = FileUtils.readFileToString(new File("filename.txt")); FileUtils.writeStringToFile(f, content.replaceAll("hello", "world"));}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)