[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

instead of re.sub

cihan

6/16/2007 11:10:00 AM

hi I want to remove all \n parts of a .txt file but I can't find the
command.

If I use .sub the code makes the only first replacement but I need it to
check all of the file.

In python language they use re but in ruby what should I do? please give
me a way.

--
Posted via http://www.ruby-....

1 Answer

Stefano Crocco

6/16/2007 11:23:00 AM

0

Alle sabato 16 giugno 2007, cihan ha scritto:
> hi I want to remove all \n parts of a .txt file but I can't find the
> command.
>
> If I use .sub the code makes the only first replacement but I need it to
> check all of the file.
>
> In python language they use re but in ruby what should I do? please give
> me a way.

Use gsub instead of sub.

Stefano