From: Miles Keaton Date: 2005-01-05T15:11:15+09:00 Subject: what's the Ruby way to do this? What's the Ruby way to do this? If I want to get the first 10 words from a phrase, followed by "..."? Although the following works, I can tell it's just not Rubyish: def snippet(thought) result = '' i = 0 thought.split.each do |word| if i < 10 result = (result + ' ' + word) end i = (i + 1) end result = result.strip + '...' return result end