Create a boolean flag outside of the for loop and initialize it to zero. If at any point in the for loop you find the string you are looking for you flip it over to one otherwise you leave it alone. Then, after the for loop is done, you check the status of that flag and output accordingly.