Scott and I are doing final edits of our OCA 8/OCP 8 Practice Tests book. We wanted to use parens after method names in the explanations. I noticed that I missed two in an early chapter so wanted to do a search in Adobe Acrobat reader for “main method”. Unfortunately Acrobat ignores the parens so “main() method” matched too.
Rather than figure out how to do this in Acrobat, I just coded it.
Path path = Paths.get("test.txt"); Files.lines(path) .filter(l -> l.contains("main method")) .forEach(System.out::println);
Broke up the reading/editing with some code too 🙂