I am looking for a way to check if the “foo” word is present in a text file using C#.
I may use a regular expression but I’m not sure that is going to work if the word is splitted in two lines. I got the same issue with a streamreader that enumerates over the lines.
Any comments ?
Here ya go. So we look at the string as we read the file and we keep track of the first word last word combo and check to see if matches your pattern.