From: Florian Gross Date: 2005-01-05T16:21:33+09:00 Subject: Re: what's the Ruby way to do this? Miles Keaton wrote: > What's the Ruby way to do this? > If I want to get the first 10 words from a phrase, followed by "..."? def snippet(thought) words = thought.split result = words.first(10).join(" ") result += "..." if words.size > 10 return result end