Link to home
Start Free TrialLog in
Avatar of Lee5
Lee5

asked on

Remove newlines from string

How can I remove all newlines from a string?
ie:
$a = "whatever including newlines";
$a =~ /whatever without newlines/;
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oops, if they are not at end of string:

   $a =~ s/[\r\n]+//;

Avatar of Lee5
Lee5

ASKER

The oops did the trick