I'm not sure the other answers you have had address all the problem. They
have all addressed the problem of (possibly multiple) whitespace (\s) at the
end of a line. You have asked to remove all the newline characters in a
string.

I would propose

$string =~ s/\n//g;

The s does a substitute; the \n is a newline character; the // contains
nothing, and achieves the removal; the g find all the occurrences;

The end result may not be what you want, hence the advice elsewhere to get
rid of carriage returns (\r).

Regards
- Roger -



----- Original Message -----
From: "Pirabakaran Kunaratnam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 8:45 PM
Subject: Help me !


> Hi People,
>
> I need to remove all new line character from a string. Can you please
> let me know. This is to use for
> a flat file. When i try to store from a textarea input to a flat file,
> it has many new line character from the input. Therefor, when retrieve
> them back from the flat file the data order are messed up. So please
> help me with this. Thanks.
>
> Piraba
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to