From: Alex LeDonne Date: 2008-01-31T04:53:57+09:00 Subject: Re: Parsing a string with quotes On Jan 30, 2008 2:28 PM, Cheri Ruska wrote: > I am trying to parse out the string: > > My dog "ate" my "math homework" and "my cat" > > into the array: > > [My, dog, ate, my, math homework, and, my cat] > > Does anybody know a good way to do this? > > Thank you in advance, > > Cheri irb(main):001:0> require 'rubygems' => false irb(main):002:0> require 'faster_csv' => true irb(main):003:0> arr = FasterCSV.parse_line( 'My dog "ate" my "math homework" and "my cat"', {:col_sep => ' '}) => ["My", "dog", "ate", "my", "math homework", "and", "my cat"]