Compare string length directly in if to get a shorter method.