From: William James Date: 2005-01-06T20:31:31+09:00 Subject: Re: what's the Ruby way to do this? def snippet(thought) thought.match(/([^\s]+(\s+|$)){0,10}/)[0]+($'>""?"...":"") end puts snippet("The quick red fox jumps over the lazy brown fat hog.") puts snippet("The quick red fox jumps over the lazy brown hog.") puts snippet("The quick red fox jumps over the lazy brown") The quick red fox jumps over the lazy brown fat ... The quick red fox jumps over the lazy brown hog. The quick red fox jumps over the lazy brown