How can I find and replace a word in several text files, using Java?
Here’s how I do it for a single String…
public class ReplaceAll {
public static void main(String[] args) {
String str = "We want replace replace word from this string";
str = str.replaceAll("replace", "Done");
System.out.println(str);
}
}
Using
FileUtilsfrom Commons IO: