This code looks a bit weird - I'm guessing .empty() checks if the string is empty, and .clear() then resets it from a string type?