[ruby-it] ricerca testo.

Lawrence Oluyede l.oluyede a gmail.com
Lun 2 Apr 2007 11:31:13 CEST


On 4/2/07, Mauro Sanna <mauro.sanna a comune.cagliari.it> wrote:
> Il giorno lun, 02/04/2007 alle 10.36 +0200, Giovanni Intini ha scritto:
> > File.open("test.txt") do |f|
> >    f.each_line {|l| puts l if l.match(/passed/i)}
> > end
> >
>
> Oppure, in una riga,
> IO.foreach("test.txt") {|l| puts l if l.match(/Passed/)}
> ;-)

Aggiungo:

http://www.oreillynet.com/ruby/blog/2007/03/getting_to_know_the_ruby_core.html

Penso che possa tornare utile all'OP


-- 
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand
something when his salary depends on not
understanding it" - Upton Sinclair


Maggiori informazioni sulla lista Ml