Java Replace Line In Text File
At the bottom, I have a general solution to replace lines in a file. But first, here is the answer to the specific question at hand. Helper function: public static void replaceSelected(String replaceWith, String type) { try { // input the file content to the StringBuffer “input” BufferedReader file = new BufferedReader(new FileReader(“notes.txt”)); StringBuffer inputBuffer … Read more