split method can split on newlines, or multiple characters at once, to get a cleaner result
puts "Words with lots of spaces".split(/\s+/).inspect