I want to search a list of strings from the file and get the line number. I am looking for an efficient way to do it. I don't want to search one string at a time and open and close file.
CodePudding user response:
Read each line and save the String found there into a Map<String, Integer>, which stores the line number in the value.
