Instead of re.sub

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.

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs