This is convenient for web applications because you often want to reject or handle differently string which contain only invisible spaces.
empty?
then that’s what going to be used. It’s interesting to see that the method and its behavior was documented fully here.