>Empty() function considers string empty if it's empty string or it includes only spaces, tabs, carriage returns, linefeeds, or any combination of these. Your approch takes into account only spaces. Maybe that's the reason?
No, it's mostly about spaces. But, it's good to know about those additional verifications that EMPTY() is doing.