What @gcjr observed is that you test your strings to see if they are equal, but what you print out are substrings of those strings. I don't think that matters because even the equals of those substrings don't match, but it's silly to test one thing and print another.