Thursday, June 12, 2014

Search through a text file?

As I continue with my book, I need to finish these challenges before I continue, but I have problems with this one :

[Image: ebe6a482fe.png]





I have everything done except one part where I have to search within the textfile whether a string exists or not. For example, my file has 80 lines and you would like to see if there's "8 Mile" in it. How would I do it? I thought of making an array and reading every line to it then use a loop to check them all?

No comments:

Post a Comment