Guest User

Untitled

a guest
Apr 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. text = %q{Los Angeles has some of the nicest weather in the country.}
  2. stop_words = %w{the a by on for of are with just but and to in the my I has some}
  3. words = text.scan(/\w+/)
  4. key_words = words.select { |bob| !stop_words.include?(bob) }
  5. puts key_words.join(' ')
Add Comment
Please, Sign In to add comment