Re: format string for array question

Cool, Thank you for the help!


Robert K.
[email protected]

----- Original Message ----
From: Gennady B. [email protected]
To: ruby-talk ML [email protected]
Sent: Monday, October 22, 2007 5:05:59 PM
Subject: Re: format string for array question

Robert K. wrote:

numbers.


Robert
[email protected]

[rh-30-x86.irvspxl08:2182]gbystrit> irb
irb(main):001:0> s = “db file parallel write 8816
391 25.49”
=> “db file parallel write 8816 391 25.49”
irb(main):002:0> s.split(%r{(?:\s+)([\d.]+)}).reject {|s| s.empty?}
=> [“db file parallel write”, “8816”, “391”, “25.49”]
irb(main):003:0>

=Gennady.

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