On 9 October 2010 19:30, Harry Kakueki <list.push / gmail.com> wrote:
>>
>> What feels a bit "awkward" to me in the first approach is to specify I
>> want no replacement (so nothing, so I should not have to specify it).
>>
>
> If you *really* want to avoid a second parameter, you could try
> something like this.
> But, I would not actually say it is better.
> Anyway....
>
>
> str = "foo bar foo bar foo"
> p str.split(/\bbar\b/)*""
>
>
> Harry

Nice one, but I guess the extra parameter is not too bad compared to this :)