Splitting A String

On Sun, Mar 18, 2007 at 01:34:07PM +0900, Bernard K. wrote:

To:

Hello,

‘a quick “brown fox” jumped “over the lazy” dog’.gsub(’"’,’’).split(/ /)

However that splits into individual words. If you look carefully at the
example, the quoted strings “brown fox” and “over the lazy” need to end
up
in a single array element in the result.

Regards,

Brian.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs