the problem is your if statement is never evaluating to true not sure why it looks fine but from what you have told me its not comming out true.
use .trim() on all your strings it might be that there are extra whitespaces.
where is the code that prints the result once your loop finishes searching im guessing this is where the problem is.
also you might want to set search to -1 then if its -1 after search completes you can say the guest has not checked in.