目录
- import java.io.File;
- import java.io.PrintWriter;
- import java.util.Scanner;
-
- public class ReplaceText {
- public static void main() throws Exception{
- File file = new File("basic\\test.txt");
- if(!file.exists()) {
- System.exit(0);
- }
-
- File targetFile = new File("basic\\target.txt");
- if(targetFile.exists()) {
- System.exit(1);
- }
-
- String oldString = "case";
- String newString = "CASE";
-
- try(
- Scanner input = new Scanner(file);
- PrintWriter output = new PrintWriter(targetFile);