Determine if string exists in file
问题 I have a list of strings such as: John John Doe Peter Pan in a .txt file. I want to make a loop that checks if a certain name exists. However, I do not want it to be true if I search for "Peter" and only "Peter Pan" exists. Each line has to be a full match. 回答1: Ha ha, ep0's answer is very sophisticated! However, you want to use a parsing loop something like this (this example expects that your names are separated by carriage returns). Consider that you have a text file with contents arranged