S. Robert James
2/22/2007 1:39:00 AM
Thanks! BTW, looking at the Rdoc, it seems each_cons is what I want,
no?
On Feb 21, 7:56 pm, "Florian Frank" <f...@nixe.ping.de> wrote:
> S. Robert James wrote:
> > I'd like to:
> > parse('Hi', 'How')
> > parse('How', 'Are')
> > parse('Are', 'you?')
> > parse('you?', false)
> > # hey, this is practically a unit test!
>
> > Any ideas?
>
> require 'enumerator'
>
> File.new(filename).enum_slice(2).each do |first, second|
> p [ first, second ? second : false ]
> end
>
> --
> Florian Frank