instead of re.sub

C

cihan

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.
 
S

Stefano Crocco

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,261
Messages
2,571,308
Members
47,976
Latest member
AlanaKeech

Latest Threads

Top