> What's the best way to return a substring that consists of the first 4
> words, if words are comma-delimited, e.g.:
>
> My first choice was:
>
> line.split(",")[0..3].join(",")
>
> but that can't be very efficient. I tried to do an explicit loop but I
> couldn't get it any better than this:

On the other hand the solution above is very readable. Are you sure that this
is where you want to save your cycles?

A solution which is similar to the one above but is more effective when the
string contains many words is:

    line.split(",", 5)[0..3].join(",")

// Niklas