Mahurshi Akilla wrote:
Is there a simple search and replace command I can do to remove all
the newline characters from a string?  (besides splitting the string
based on \n and then joining the elements)

This seems pretty basic but the below commands don't seem to work:
s/\\n//g
s/\n//g

The latter works fine for me:

$ perl -le '$_ = "one\ntwo\nthree\n"; s/\n//g; print'
onetwothree
$

I guess you need to tell us more if anybody shall be able to help you.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to