Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: How to remove a carriage return (\r\n)

by jgallagher (Pilgrim)
on Nov 01, 2005 at 18:44 UTC ( #504690=note: print w/replies, xml ) Need Help??


in reply to Re: How to remove a carriage return (\r\n)
in thread How to remove a carriage return (\r\n)

But what happens when $str = "ab\ncd\r\n"? Or can we assume there are no line breaks except at the end of lines?

Replies are listed 'Best First'.
Re^3: How to remove a carriage return (\r\n)
by 3dbc (Scribe) on Nov 13, 2012 at 16:13 UTC
    $line =~ s/\R//g;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://504690]
help
Chatterbox?
jedikaiti is glad to see the conditioning persists...
[jedikaiti]: And yes, I have saved down a copy and added it to my walpaper rotation
[zentara]: jedikaiti my condition has a condition :-)
[jedikaiti]: :-D
[Your Mother]: ♫ You say apod, I say Perl POD ... let's call the whole thing off ♬

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-08-18 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (305 votes). Check out past polls.

    Notices?